Skip to content

Documentation / @ripl/utilities / functionCache

Function: functionCache()

functionCache<TValue>(value): CachedFunction<TValue>

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

Wraps a function so its result is computed once and then returned from cache on subsequent calls until invalidate() is called.

Type Parameters

Type Parameter
TValue extends AnyFunction

Parameters

ParameterType
valueTValue

Returns

CachedFunction<TValue>