Skip to content

Instantly share code, notes, and snippets.

@jorgeucano
Created July 10, 2018 16:39
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