Interface LRUCacheOptions<K, V>

interface LRUCacheOptions<K = string, V = unknown> {
    max?: number;
    ttl?: number;
    updateAgeOnGet?: boolean;
    dispose(val: LRUCacheItem<V>, key: K, reason: DisposeReason): void;
}

Type Parameters

  • K = string
  • V = unknown

Properties

Methods

Properties

max?: number

The maximum number of items that remain in the cache. default 500

ttl?: number

how long to live in ms. default 0

updateAgeOnGet?: boolean

Methods

  • Function that is called on items when they are dropped from the cache

    Parameters

    • val: LRUCacheItem<V>
    • key: K
    • reason: DisposeReason

    Returns void