memoizeByKey
Documentation / @elitechart/core / memoizeByKey
Defined in: util/memoize.ts:55
Wrap compute so repeated calls with the same keyFn(args) return
the cached result. Single-slot — the most recent key wins.
Use when the compute depends on more than one input dimension; e.g.
(bars, period) or (bars, { period, stdDev }).
Type Parameters
A
A extends readonly unknown[]
R
R
Parameters
compute
(...args) => R
keyFn
(...args) => string
Returns
(...args) => R