25 lines
409 B
JavaScript
25 lines
409 B
JavaScript
|
class FreqManager {
|
||
|
#store;
|
||
|
static getInstance() {
|
||
|
if (this._instance === null) {
|
||
|
this._instance = new FreqManager();
|
||
|
}
|
||
|
return this._instance;
|
||
|
}
|
||
|
|
||
|
constructor() {
|
||
|
this.#store = {};
|
||
|
}
|
||
|
|
||
|
set(key, value) {
|
||
|
this.#store[key] = value;
|
||
|
}
|
||
|
|
||
|
get(key) {
|
||
|
return this.#store[key];
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
window.freq = FreqManager.getInstance();
|