Skip to content

Documentation / @ripl/utilities / MemoizedFunction

Type Alias: MemoizedFunction()<TValue, TKey>

MemoizedFunction<TValue, TKey> = ReturnType<TValue>

Defined in: packages/utilities/src/function.ts:17

A function wrapper that caches results per unique key, exposing the underlying cache Map.

Type Parameters

Type Parameter
TValue extends AnyFunction
TKey

MemoizedFunction(...args): ReturnType<TValue>

A function wrapper that caches results per unique key, exposing the underlying cache Map.

Parameters

ParameterType
...argsParameters<TValue>

Returns

ReturnType<TValue>

Properties

cache

cache: Map<TKey, ReturnType<TValue>>

Defined in: packages/utilities/src/function.ts:20

The underlying cache mapping each unique key to its memoized result.