UNPKG

@blocklet/payment-react

Version:

Reusable react components for payment kit v2

29 lines (28 loc) 680 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.globalCache = void 0; class GlobalCacheManager { static instance; cacheMap; constructor() { this.cacheMap = /* @__PURE__ */new Map(); } static getInstance() { if (!GlobalCacheManager.instance) { GlobalCacheManager.instance = new GlobalCacheManager(); } return GlobalCacheManager.instance; } get(cacheKey) { return this.cacheMap.get(cacheKey); } set(cacheKey, item) { this.cacheMap.set(cacheKey, item); } delete(cacheKey) { this.cacheMap.delete(cacheKey); } } const globalCache = exports.globalCache = GlobalCacheManager.getInstance();