All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- [Breaking]
cached()
with null/undefinedkey
returns unmodded hook, which would return a no-op function in place of the thirdremove
function.
- More reliable check against
useState
anduseReducer
, eliminates false error of unsupported hooks when working with obfuscated React library, a very common case when vendorizing using bundlers such as webpack.
- Upgrade all devDependencies, with lint and test fixes.
ttlMS
optional parameter, a proxy to the underlyinglscache.setExpiryMilliseconds
.cached
now accepts parameters as an Object (i.e.cached({ key, ttl, ttlMS })
). The positional params will be deprecated in 2.0.
- Routine
devDependencies
upgrade.
cached(hook)
return list third item -remove
function for programmatic cache removal, while keeping current in-memory state intact.
cached
is additionally exported as default.
useEffect
based cache update mechanism.- [Breaking] drastically changed interface (as one higher-order-function,
cached
) - [Breaking]
useCachedState
is replaced bycached
higher-order-function.
useReducer
support for revised higher-order-functioncached
.
- Initial implementation of
useCachedState
.