vue-admin-core
Version:
A Component Library for Vue 3
20 lines (17 loc) • 499 B
JavaScript
;
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