UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

15 lines (14 loc) • 284 B
function memo(fn) { const cache = /* @__PURE__ */ new Map(); return function cached(...args) { const key = args.join(""); if (!cache.has(key)) { cache.set(key, fn(...args)); } return cache.get(key); }; } export { memo }; //# sourceMappingURL=memo.js.map