In an Angular app, I\'m managing my subscriptions by pushing them all into an array, then looping through it and unsubscribing during ngOnDestroy.
ngOnDestroy
p
subs: Subscription[] = []; ngOnInit(): void { this.subs.push(someObservable.subscribe(foo => bar)); } ngOnDestroy(): void { this.subs.map(s => s.unsubscribe); }