UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

24 lines 596 B
/** * Store something in {@link SpreadSheet} temporary along with it's lifecycle * All the keys need be declare in {@see StoreKey} first */ export 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; } } //# sourceMappingURL=index.js.map