Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit af8dc79

Browse files
refactor(database): dry out code
1 parent 1fbad2f commit af8dc79

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/database.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,10 @@ export class AngularFireOfflineDatabase {
160160
*/
161161
private processingComplete() {
162162
this.processing.current = false;
163-
Object.keys(this.processing.listCache).forEach(cacheKey => {
164-
this.listCache[cacheKey].sub.next( this.processing.listCache[cacheKey] );
165-
});
166-
Object.keys(this.processing.objectCache).forEach(cacheKey => {
167-
this.objectCache[cacheKey].sub.next( this.processing.objectCache[cacheKey] );
163+
['list', 'object'].forEach(type => {
164+
Object.keys(this.processing[`${type}Cache`]).forEach(cacheKey => {
165+
this[`${type}Cache`][cacheKey].sub.next( this.processing[`${type}Cache`][cacheKey] );
166+
});
168167
});
169168
}
170169
/**

0 commit comments

Comments
 (0)