Type Alias Options<KeyType, ValueType>
type Options<KeyType, ValueType> = {
maxAge?: number;
maxSize: number;
onEviction?: (key: KeyType, value: ValueType) => void;
}
maxAge?: number;
maxSize: number;
onEviction?: (key: KeyType, value: ValueType) => void;
}
Type Parameters
- KeyType
- ValueType
Index
Properties
Properties
Optional ReadonlymaxAge
maxAge?: number
ReadonlymaxSize
maxSize: number
The maximum number of items before evicting the least recently used items.
OptionalonEviction
Called right before an item is evicted from the cache.
Useful for side effects or for items like object URLs that need explicit cleanup (revokeObjectURL).
The maximum number of milliseconds an item should remain in the cache.