UNPKG

vue-admin-core

Version:
17 lines (15 loc) 444 B
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); }); }; export { getCachePromise, setCachePromise }; //# sourceMappingURL=cachePromise.mjs.map