@hadss/hmrouter-plugin
Version:
HMRouter Compiler Plugin
30 lines (29 loc) • 673 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PluginStore = void 0;
class PluginStore {
constructor() {
this.dataMap = new Map();
}
set(key, value) {
this.dataMap.set(key, value);
}
get(key) {
return this.dataMap.get(key);
}
clear() {
this.dataMap.clear();
}
static destroy() {
this.getInstance().clear();
this.instance = null;
}
static getInstance() {
if (!this.instance) {
this.instance = new PluginStore();
}
return this.instance;
}
}
exports.PluginStore = PluginStore;
PluginStore.instance = null;