Created
July 10, 2018 16:39
-
-
Save jorgeucano/a816c238b76a1ab7d0a83f184ff9af55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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