Skip to content

Instantly share code, notes, and snippets.

@bogdanconstantinescu
Created November 8, 2019 16:34
Show Gist options
  • Save bogdanconstantinescu/c5b998ebb1682ae1e5a97dc4f75a5bd0 to your computer and use it in GitHub Desktop.
Save bogdanconstantinescu/c5b998ebb1682ae1e5a97dc4f75a5bd0 to your computer and use it in GitHub Desktop.

Revisions

  1. bogdanconstantinescu created this gist Nov 8, 2019.
    11 changes: 11 additions & 0 deletions base.component.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import { OnDestroy } from '@angular/core';
    import { Subject } from 'rxjs';

    export abstract class BaseComponent implements OnDestroy {
    public ngDestroyed$ = new Subject();

    ngOnDestroy() {
    this.ngDestroyed$.next();
    this.ngDestroyed$.unsubscribe();
    }
    }