Created
July 10, 2018 16:39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private mergeAllSnapshots(data: Array<any>) { | |
return combineLatest(...data) | |
.switchMap(allData => { | |
const combined = []; | |
combined.push([].concat(...allData)); | |
return Observable.of(combined[0]); | |
}).map(actions => { | |
return actions.map(a => { | |
const data = a.payload.doc.data(); | |
const id = a.payload.doc.id; | |
return { id, ...data }; | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment