R
I

UseMemoizeCache

testeddemo

Pluggable cache backend. Any object implementing this shape can be supplied via `options.cache` to control storage (e.g. an LRU cache). When omitted a plain `Map` is used and the heavy lifting is delegated to `@robonen/stdlib`'s `memoize`.

Demo

Loading demo…

Signature

ts
interface UseMemoizeCache<Key, Value>

Type Parameters

Key
Value

Properties

PropertyTypeDescription
get(key: Key) => Value | undefinedRead the cached value for `key`, or `undefined` when absent.
set(key: Key, value: Value) => voidStore `value` under `key`.
has(key: Key) => booleanWhether a value is cached for `key`.
delete(key: Key) => voidDrop the cached value for `key`.
clear() => voidDrop every cached value.