Last active
May 13, 2019 02:06
-
-
Save cartant/a3e5932220390befde081765b48cdffa 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
import { concat, of, race, timer } from "rxjs"; | |
import { delay, mapTo, publish } from "rxjs/operators"; | |
const source = of(42).pipe(delay(100)); | |
const composed = source.pipe( | |
publish(published => race( | |
published, | |
concat(timer(10).pipe(mapTo(54)), published) | |
)) | |
); | |
composed.subscribe(value => console.log(value)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment