Created
November 11, 2019 10:39
-
-
Save CharGrnmn/a9c0cbc9c8ce4a8b0d874a413365ea16 to your computer and use it in GitHub Desktop.
Rxjs, cold, with two subscribes
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 { Subject } from 'rxjs'; | |
| const randomVals$ = new Subject().next(Math.random());} | |
| // Subscribe to run the combined functions | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.24957144215097515 (random number) | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.004617340049055896 (random number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment