Skip to content

False positive for rxjs-angular/prefer-takeuntilΒ #14

@vladkasianenko

Description

@vladkasianenko
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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions