UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

21 lines (17 loc) 466 B
'use strict'; var core = require('@liveblocks/core'); function memoize(fn) { const cache = /* @__PURE__ */ new Map(); return (...args) => { const key = JSON.stringify(args.map((arg) => core.stableStringify(arg))); const cached = cache.get(key); if (cached !== void 0) { return cached; } const result = fn(...args); cache.set(key, result); return result; }; } exports.memoize = memoize; //# sourceMappingURL=memoize.cjs.map