LruCacheOptions

import { LruCacheOptions } from "jsr:@ende/cache";

interface ยท experimental

interface LruCacheOptions<K, V>

Options for the LruCache constructor.

Properties

onEject

onEject?: (ejectedKey: K, ejectedValue: V, reason: LruCacheEjectionReason) => void

Callback invoked when an entry is removed, whether by eviction, manual deletion, or clearing the cache. The entry is already removed from the cache when this callback fires. Overwriting an existing key via set() does not trigger this callback. The cache is not re-entrant during this callback: calling set, delete, or clear will throw.

Source