v3.0.0
3.0.0 (2022-10-24)
Bug Fixes
BREAKING CHANGES
-
CacheMetadata.swv has been renamed to CacheMetadata.swr
for the most part this will be handled by the library
(existing cache entries withswv
will continue to work, only new ones will useswr
)Migration:
When you worked withCacheMetadata
(for example in a custom cache adapter)
you need to adapt your code to:- write
swr
instead ofswv
👍 new:const metadata: CacheMetadata = { swr: 1000, /* ... */ }
⛔️ old:const metadata: CacheMetadata = { swv: 1000, /* ... */ }
- read using the
staleWhileRevalidate
helper
👍 new:const staleMs = staleWhileRevalidate(metadata)
⛔️ old:const staleMs = metadata.swv
- write
-
The
Cache
type is not generic anymore and always usesunknown
for values
You might need to adjust your cache implementations and caches to now work on
unknown data types. Typescript should inform you where.
Nothing to be done when you only used the build-in cache adapters.