Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const s = new Subject();
- const subscriber1 = s.subscribe(...);
- const subscriber2 = s.subscribe(...);
- s.complete(); // both subscribers will receive the complete notification
- // or with `take(1)` operator it'll call `complete()` for you
- const subscriber1 = s.take(1).subscribe(...);
- const subscriber2 = s.take(1).subscribe(...);
- s.next(42); // both subscribers will receive the complete notification
Add Comment
Please, Sign In to add comment