@antv/s2
Version:
effective spreadsheet render core lib
28 lines • 713 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Store = void 0;
/**
* Store something in {@link SpreadSheet} temporary along with it's lifecycle
* All the keys need be declare in {@see StoreKey} first
*/
class Store {
constructor() {
this.store = new Map();
}
set(key, value) {
return this.store.set(key, value);
}
get(key, defaultValue) {
var _a;
const value = this.store.get(key);
return (_a = value) !== null && _a !== void 0 ? _a : defaultValue;
}
clear() {
this.store.clear();
}
size() {
return this.store.size;
}
}
exports.Store = Store;
//# sourceMappingURL=index.js.map