Spaces:
Sleeping
Sleeping
File size: 267 Bytes
56fda74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = memoize;
function memoize(fn) {
const cache = {};
return arg => {
if (cache[arg] === undefined) {
cache[arg] = fn(arg);
}
return cache[arg];
};
} |