Skip to content

Instantly share code, notes, and snippets.

@CharGrnmn
Created November 11, 2019 10:39
Show Gist options
  • Select an option

  • Save CharGrnmn/92b9447fc87d3a9a659056c2a35248f6 to your computer and use it in GitHub Desktop.

Select an option

Save CharGrnmn/92b9447fc87d3a9a659056c2a35248f6 to your computer and use it in GitHub Desktop.
Rxjs, cold, with two subscribes
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