Created
October 18, 2021 12:12
-
-
Save trubachoff/960510a1948d411b45909474a3eec11c to your computer and use it in GitHub Desktop.
Angular abstract onDestroy calss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Subject } from 'rxjs'; | |
import { Injectable, OnDestroy } from '@angular/core'; | |
@Injectable() | |
export class AbstractBasicComponent implements OnDestroy { | |
protected destroy$ = new Subject(); | |
public ngOnDestroy(): void { | |
this.destroy$.next(); | |
this.destroy$.complete(); | |
} |
Author
trubachoff
commented
Oct 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment