UNPKG

vue-admin-core

Version:
20 lines (17 loc) 499 B
'use strict'; const cachePromise = /* @__PURE__ */ new Map(); const getCachePromise = (cacheKey) => { return cachePromise.get(cacheKey); }; const setCachePromise = (cacheKey, promise) => { cachePromise.set(cacheKey, promise); promise.then((res) => { cachePromise.delete(cacheKey); return res; }).catch(() => { cachePromise.delete(cacheKey); }); }; exports.getCachePromise = getCachePromise; exports.setCachePromise = setCachePromise; //# sourceMappingURL=cachePromise.js.map