Created
April 4, 2019 10:20
-
-
Save kosich/cca5146802c43c401e4742c7b6e96340 to your computer and use it in GitHub Desktop.
combineLatest with timers
This file contains 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 { map, take } = require('rxjs/operators'); | |
const timerOne = timer(100, 400); | |
const timerTwo = timer(200, 400); | |
const timerThree = timer(300, 400); | |
timerOne.subscribe(rxObserver()); | |
timerTwo.subscribe(rxObserver()); | |
timerThree.subscribe(rxObserver()); | |
combineLatest(timerOne, timerTwo, timerThree, (...arr)=>arr.join('-')) | |
.subscribe(rxObserver()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment