Skip to content

Documentation / @ripl/utilities / functionMemoize

Function: functionMemoize()

functionMemoize<TValue, TKey>(value, resolver?): MemoizedFunction<TValue, TKey>

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

Memoizes a function by caching results keyed by the resolver (defaults to the first argument).

Type Parameters

Type ParameterDefault type
TValue extends AnyFunction-
TKeyParameters<TValue>[0]

Parameters

ParameterType
valueTValue
resolverMemoizeResolver<TValue, TKey>

Returns

MemoizedFunction<TValue, TKey>