mirror of
https://github.com/wekan/wekan.git
synced 2026-02-20 23:14:07 +01:00
- Clone @wekanteam/meteor-reactive-cache to npm-packages/ - Add .meteorignore to exclude npm-packages from Meteor - Update package.json to use local file path This allows direct modification of the package for Meteor 3.0 async migration while maintaining publishability to npm.
28 lines
No EOL
1.9 KiB
JavaScript
28 lines
No EOL
1.9 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = void 0;
|
|
var _DataCache = _interopRequireDefault(require("./DataCache"));
|
|
var _ejson = _interopRequireDefault(require("./meteor/ejson"));
|
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
var _default = exports["default"] = function _default(fn, compare) {
|
|
var cache = new _DataCache["default"](function (key) {
|
|
return fn.apply(void 0, _toConsumableArray(_ejson["default"].parse(key)));
|
|
}, compare);
|
|
var resolver = function resolver() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return cache.get(_ejson["default"].stringify(args));
|
|
};
|
|
resolver.cache = cache;
|
|
return resolver;
|
|
}; |