Open jsartisan opened 2 months ago
index.js
export function memo(func) { const cache = {}; return function(...args) { const key = JSON.stringify(args); if (!(key in cache)) { cache[key] = func.apply(this, args); } return cache[key]; } }
index.js