Skip to content

ngOnDestroy is not implemented raised by prefer-takeuntil rule when ngOnDestroy is in a super class #1

@ldulary

Description

@ldulary

Considering this super class :

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions