UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

19 lines 418 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.memoize = void 0; /** * @since 0.9.4 */ 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); }; } exports.memoize = memoize; //# sourceMappingURL=Schemable.js.map