Readonly
lruInvalidate a cache item, so that it will be fetched again the next time it is requested.
The key to used to identify the cached data.
Whether the cache item was invalidated.
Wrap an async function with a cache.
If the cache is empty, the async function will be run and the result will be stored in the cache. If the cache is not empty, the async function will not be run and the result will be returned from the cache.
All the cached items are stored by reference, so if you modify the returned cached data, it will also modify the cached data internally. Nesting this function will also forward those references up the chain, so doing a cache wrap inside a cache wrap is a great way to share data between functions and avoid unnecessary object creation and garbage collection.
The result of the async function.
Generated using TypeDoc
A cache that can be used to store data for the lifetime of the this object.
It uses LRU caching, so it will automatically remove the least recently used items when it reaches its limits. And also has expiries, so it will automatically replace items that have not been used for a while.
It's a small wrapper over LRUCache npm package.
See
https://www.npmjs.com/package/lru-cache