Optional
cloneOptional
cloneCustom function to be used with the clone
option. If not passed, JSON.parse(JSON.stringify(value))
is used for cloning objects.
Optional
entryThe time to live for this cache entry. Setting this to null
will make entry never expire. Default value is null
.
Optional
onFunction to be called whenever this entry is evicted from the cache (when evicted due to needing to make room, is expired, or deleted using delete()). Passed argument is an object:
{
key: TKey;
value: TValue;
isExpired: boolean;
}
Optional
onFunction to be called whenever this entry is marked as recently used (on set, get, find, etc). Passed argument is an object:
{
key: TKey;
value: TValue;
}
Generated using TypeDoc
Clone values being set and fetched from the cache (clones on set and any retrievals). Useful to maintain immutability. NOTE! This does come with performance overhead (almost twice as slow). Defaults to false.