UNPKG

@rcsb/rcsb-saguaro

Version:
24 lines (23 loc) 605 B
export class RowStatusMap { constructor() { this.rowReadyMap = new Map(); } set(key, value) { this.rowReadyMap.set(key, value); } size() { return this.rowReadyMap.size; } clear(rowIds) { if (rowIds) rowIds.forEach(id => this.rowReadyMap.delete(id)); else this.rowReadyMap.clear(); } complete() { return Array.from(this.rowReadyMap.values()).filter(a => a).length == this.rowReadyMap.size; } completed() { return Array.from(this.rowReadyMap.values()).filter(a => a).length; } }