You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Directive, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
@Directive()
export class Destroy implements OnDestroy {
protected destroyed$ = new Subject();
public ngOnDestroy() {
this.destroyed$.next();
this.destroyed$.unsubscribe();
}
}
In the components extending Destroy, having takeUntil(this.destroyed$) before each subscribe should be enough to fullfill prefer-takeuntil rule.
But there is the following issue : error `ngOnDestroy` is not implemented rxjs-angular/prefer-takeuntil
Allcharles, mxlle, dkimmich-onventis, GavinWu1991, altsanz and 6 more