MCPcopy Index your code
hub / github.com/formatjs/formatjs / memoize

Function memoize

packages/fast-memoize/index.ts:37–50  ·  view source on GitHub ↗
(fn: F, options?: Options<F>)

Source from the content-addressed store, hash-verified

35}
36
37export function memoize<F extends Func>(fn: F, options?: Options<F>): F {
38 const cache = options && options.cache ? options.cache : cacheDefault
39
40 const serializer =
41 options && options.serializer ? options.serializer : serializerDefault
42
43 const strategy =
44 options && options.strategy ? options.strategy : strategyDefault
45
46 return strategy(fn, {
47 cache,
48 serializer,
49 })
50}
51
52//
53// Strategy

Callers 8

createFormattersFunction · 0.90
defaultTimezone.tsFile · 0.90
memoize.tsFile · 0.90
utils.tsFile · 0.90
decimal-cache.tsFile · 0.90
createDefaultFormattersFunction · 0.90
benchmark.tsFile · 0.90
utils.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected