Created
May 3, 2021 09:02
-
-
Save armanozak/4d4b9f1a47672bbfe784a078e18bcbd5 to your computer and use it in GitHub Desktop.
[What's New in RxJS 7] Observable dictionaries in RxJS 6 forkJoin #blog #rxjs
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
import { forkJoin, interval } from "rxjs"; | |
import { map } from "rxjs/operators"; | |
const count1To5$ = interval(1000).pipe( | |
take(5), | |
map(i => i + 1) | |
); | |
const count6To9$ = interval(1000).pipe( | |
take(4), | |
map(i => i + 6) | |
); | |
forkJoin({ x: count1to5$, y: count6to9$ }).subscribe(console.log); | |
// (after ~5s) {x: 5, y: 9} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment