Class LruCache<K, V>Experimental
Type Parameters
Implements
Properties
Readonly Experimental[toStringTag]
[toStringTag] : string
ExperimentalmaxSize
maxSize : number
The maximum number of entries to store in the cache.
Readonly Experimentalsize
size: number
Static Readonly Experimental[species]
[species]: MapConstructor
Methods
[iterator]
clear
delete
- delete(key): boolean
ExperimentalParameters
- key: K
Returns boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
entries
forEach
get
has
- has(key): boolean
ExperimentalChecks whether an element with the specified key exists or not.
Parameters
- key: K
The key to check.
Returns boolean
trueif the cache contains the specified key, otherwisefalse.- key: K
Least-recently-used cache.
UNSTABLE: New API, yet to be vetted.
See
Least-recently-used cache
Automatically removes entries above the max size based on when they were last accessed with
get,set, orhas.Example: Basic usage