1.0.0 • Published 5 years ago

@devcorp-libs/ng-unsubscribe v1.0.0

Weekly downloads
2
License
-
Repository
github
Last release
5 years ago

NgUnsubscribe

Base class for handling unsubscribe on destroy

Usage

Just extend NgUnsubscribe class and use takeUntil(this.ngUnsubscribe) pipe on each observable

Example how to use it

@Component({
  ...
})
export class MyComponent extends NgUnsubscribe {

  public readonly sub$: Observable<any>;

  constructor() {
    super();
    
    this.sub$ = of({}).pipe(
      takeUntil(this.ngUnsubscribe),
    )        
  }
}
1.0.0

5 years ago

0.0.1

5 years ago