MCPcopy Index your code
hub / github.com/plotly/dash / memoizeAll

Function memoizeAll

components/dash-table/src/core/memoizer.ts:49–60  ·  view source on GitHub ↗
(
    fn: ResultFn<TArgs, TEntry>
)

Source from the content-addressed store, hash-verified

47}
48
49export function memoizeAll<TArgs extends any[], TEntry>(
50 fn: ResultFn<TArgs, TEntry>
51): ResultFn<TArgs, TEntry> {
52 const cache: {args: TArgs; result: TEntry}[] = [];
53
54 return (...args: TArgs): TEntry => {
55 const entry = cache.find(e => isEqualArgs(e.args, args));
56
57 return (entry || cache[cache.push({args, result: fn(...args)}) - 1])
58 .result;
59 };
60}

Callers

nothing calls this directly

Calls 4

isEqualArgsFunction · 0.90
findMethod · 0.80
pushMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…