Skip to content

Instantly share code, notes, and snippets.

@ArtemRomanovsky
Created February 19, 2020 15:12
Show Gist options
  • Save ArtemRomanovsky/8061e061ba9082b9bdfd2ec267f9fce5 to your computer and use it in GitHub Desktop.
Save ArtemRomanovsky/8061e061ba9082b9bdfd2ec267f9fce5 to your computer and use it in GitHub Desktop.
const observable = Rx.Observable.interval(1000).take(5);
const observerA = {...};
const observerB = {...};
const subject = new Rx.Subject();
observable.subscribe(subject);
subject.subscribe(observerA); // first execution
setTimeout(() => {
subject.subscribe(observerB); // the same execution
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment