1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
export class SyncStatusHub { private map = new Map<string, boolean>(); get(key: string): boolean { return this.map.get(key) ?? false; } begin(key: string): void { this.map.set(key, true); } end(key: string): void { this.map.set(key, false); } } export const syncStatusHub = new SyncStatusHub(); export default syncStatusHub;