@rcsb/rcsb-saguaro
Version:
RCSB 1D Feature Viewer
24 lines (23 loc) • 605 B
JavaScript
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;
}
}