Is it possible to get all the \"active\" subscriptions without storing them manually?
I\'d like to unsubscribe
all of the \"active\" subscriptions and don\'
One of the options is to use takeUntil in combination with Subject to stop all (Observable) subscriptions.
terminator$: Subject<boolean> = new Subject();
Observable.timer(1000)
.do(i => console.log(`timer 1: ${i}`))
.takeUntil(terminator$)
.subscribe();
Observable.timer(5000)
.do(i => console.log(`timer 2: ${i}`))
.takeUntil(terminator$)
.subscribe();
const stopSubscriptions = () => terminator$.next(true);