Last active
December 30, 2016 12:57
-
-
Save jsayol/b09be96ff8751e24f6a45675539e8bf1 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
const show$ = Observable.timer(0, 1000); | |
const hide$ = Observable.timer(750, 1000); | |
const blinker$ = Observable.merge( | |
show$.mapTo('showing'), | |
hide$.mapTo('hiding') | |
); | |
blinker$.subscribe(value => console.log(value)); | |
// Delay: Output: | |
/* 0 ms */ showing | |
/* 750 ms */ hiding | |
/* 250 ms */ showing | |
/* 750 ms */ hiding | |
/* 250 ms */ showing | |
/* 750 ms */ hiding | |
/* 250 ms */ showing | |
/* 750 ms */ hiding | |
/* ... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment