I
UseMemoizeCache
testeddemoPluggable 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
KeyValueProperties
| Property | Type | Description |
|---|---|---|
get | (key: Key) => Value | undefined | Read the cached value for `key`, or `undefined` when absent. |
set | (key: Key, value: Value) => void | Store `value` under `key`. |
has | (key: Key) => boolean | Whether a value is cached for `key`. |
delete | (key: Key) => void | Drop the cached value for `key`. |
clear | () => void | Drop every cached value. |