UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

15 lines 295 B
/** * @since 0.9.4 */ export function memoize(f) { const cache = new Map(); return (a) => { if (!cache.has(a)) { const b = f(a); cache.set(a, b); return b; } return cache.get(a); }; } //# sourceMappingURL=Schemable.js.map