Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

weak-memoize.cjs.dev.js 454B

1234567891011121314151617181920
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var weakMemoize = function weakMemoize(func) {
  4. // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
  5. var cache = new WeakMap();
  6. return function (arg) {
  7. if (cache.has(arg)) {
  8. // $FlowFixMe
  9. return cache.get(arg);
  10. }
  11. var ret = func(arg);
  12. cache.set(arg, ret);
  13. return ret;
  14. };
  15. };
  16. exports.default = weakMemoize;