UNPKG

transitory

Version:

In-memory cache with high hit rates via LFU eviction. Supports time-based expiration, automatic loading and metrics.

7 lines (6 loc) 265 B
import { KeyType } from '../KeyType'; /** * Decider for how long something stays cached. Takes in the key and the value * and should return a maximum age in milliseconds. */ export declare type MaxAgeDecider<K extends KeyType, V> = (key: K, value: V) => number;