-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
private readonly _destroy$ = new Subject<void>();
myLuckyNumber$ = this.service.getNumber().pipe(takeUntil(this._destroy$));
ngOnInit(): void {
this.myLuckyNumber$.subscribe(); // Forbids calling `subscribe` without an accompanying `takeUntil` rxjs-angular/prefer-takeuntil
const anotherNumber$ = this.service.getNumber().pipe(takeUntil(this._destroy$));
anotherNumber$.subscribe(); // Forbids calling `subscribe` without an accompanying `takeUntil` rxjs-angular/prefer-takeuntil
}
ngOnDestroy() {
this._destroy$.next();
this._destroy$.unsubscribe();
}dangrussell
Metadata
Metadata
Assignees
Labels
No labels