use ES6 Map if we can (#602)

This commit is contained in:
Jordi Bunster
2021-04-27 08:14:21 -07:00
committed by GitHub
parent 127784abdd
commit 5cf16d01b5
20 changed files with 106 additions and 478 deletions

View File

@@ -930,7 +930,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
}
private cleanupDatabasesKoSubs(): void {
this.koSubsDatabaseIdMap.keys().forEach((databaseId: string) => {
for (const databaseId of this.koSubsDatabaseIdMap.keys()) {
this.koSubsDatabaseIdMap.get(databaseId).forEach((sub: ko.Subscription) => sub.dispose());
this.koSubsDatabaseIdMap.delete(databaseId);
@@ -939,7 +939,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
.get(databaseId)
.forEach((collectionId: string) => this.cleanupKoSubsForCollection(databaseId, collectionId));
}
});
}
}
private cleanupCollectionsKoSubs(databaseId: string, existingCollectionIds: string[]): void {