vue-admin-core
Version:
A Component Library for Vue 3
17 lines (15 loc) • 444 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);
});
};
export { getCachePromise, setCachePromise };
//# sourceMappingURL=cachePromise.mjs.map