Skip to content

Instantly share code, notes, and snippets.

@pgiemza
Created June 5, 2017 06:55
Show Gist options
  • Save pgiemza/1b81188e56ff24c977e605f9feb1d2f2 to your computer and use it in GitHub Desktop.
Save pgiemza/1b81188e56ff24c977e605f9feb1d2f2 to your computer and use it in GitHub Desktop.
import { OnDestroy } from '@angular/core';
import { Subject } from 'rxjs/Subject';
export abstract class BaseComponent implements OnDestroy {
protected destroyed$: Subject<boolean> = new Subject();
protected constructor() {}
ngOnDestroy(): void {
this.destroyed$.next(true);
this.destroyed$.complete();
}
}
@dchirutac
Copy link

Clever, implemented with success. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment