Created
January 21, 2019 19:08
-
-
Save agustinhaller/c84a0cb909a22d027702f8f6cc625beb to your computer and use it in GitHub Desktop.
angular 7 forkJoin
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
// See: https://www.learnrxjs.io/operators/combination/forkjoin.html | |
// Added take(1) bc of this behaviour: https://github.com/angular/angularfire2/issues/617#issuecomment-255513958 | |
forkJoin( | |
this.firebaseService.getUserEventsForDevice(selectedDevice.key, filterCriteria).pipe(take(1)), | |
this.firebaseService.getEventsFromDevice(selectedDevice.key, filterCriteria).pipe(take(1)) | |
) | |
.subscribe( | |
([userEvents, deviceEvents]) => { | |
console.log('userEvents', userEvents); | |
console.log('deviceEvents', deviceEvents); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment