Bits of code
SubSink
Installation
npm install subsink --saveAngular examples
Easy Syntax
export class SomeComponent implements OnDestroy {
private subs = new SubSink();
...
this.subs.sink = observable$.subscribe(...);
this.subs.sink = observable$.subscribe(...);
this.subs.sink = observable$.subscribe(...);
...
// Unsubscribe when the component dies
ngOnDestroy() {
this.subs.unsubscribe();
}
}The Array/Add Technique
Get results of chained observables in subscription
Last updated