Interface: LRUCacheOptions
Defined in: lru-cache.ts:32 Configuration for LRUCache.Properties
defaultTTL?
Defined in: lru-cache.ts:43 Default time-to-live in milliseconds for entries inserted without a per-call TTL. Omit for entries that never expire by time. Expired entries are evicted lazily on the nextoptionaldefaultTTL?:number
get/has access.
maxSize
maxSize: number
Defined in: lru-cache.ts:37
Maximum number of entries the cache will hold. Once exceeded, the
least-recently-used entry is evicted.
onEvict?
Defined in: lru-cache.ts:51 Optional callback invoked whenever an entry is evicted to make room for a new one. Receives the key and value of the evicted entry. Not called on explicitoptionalonEvict?: <K,V>(key,value) =>void
delete() or clear(), and not called when
an entry is removed because it expired.
Type Parameters
K
K
V
V
Parameters
key
K
value
V
Returns
void