Created
February 12, 2021 01:11
-
-
Save kaiguogit/60c15f9e06179d37368043ef3684a865 to your computer and use it in GitHub Desktop.
filter-combinelatest
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
| const { rxObserver } = require('api/v0.3'); | |
| const { timer, combineLatest } = require('rxjs'); | |
| const { take, filter } = require('rxjs/operators'); | |
| const a$ = timer(0, 10).pipe( | |
| take(5) | |
| ); | |
| const b$ = timer(0, 4).pipe( | |
| take(7) | |
| ); | |
| const c$ =timer(0, 10).pipe(take(5), filter(() => false)) | |
| const result$ = combineLatest(a$, b$, c$); | |
| a$.subscribe(rxObserver('a$')); | |
| b$.subscribe(rxObserver('b$')); | |
| b$.subscribe(rxObserver('c$')); | |
| result$.subscribe(rxObserver('combineLatest(a$, b$)')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment