Skip to content

Instantly share code, notes, and snippets.

View xtianjohns's full-sized avatar

Christian Johns xtianjohns

View GitHub Profile

Keybase proof

I hereby claim:

  • I am xtianjohns on github.
  • I am xtianjohns (https://keybase.io/xtianjohns) on keybase.
  • I have a public key ASBRggcBWFtm55B0QPO9BeIjjBqP-5Qf9_2yY6-V4vF1kQo

To claim this, I am signing this object:

@Component({
selector: 'my-component',
})
export class MyComponent implements OnInit {
@NgDestroy() // decorate the property you want to use to track your destruction
private destroyed$: Observable<{}>;
ngOnInit(): void {
Observable.interval( 1000 )
@xtianjohns
xtianjohns / component_takeWhile.ts
Created June 4, 2017 18:41
takeWhile for fun and for profit
import { Component, OnInit, OnDestroy } from '@angular/core';
import { MyService } from './MyService.ts';
import 'rxjs/add/operator/takeWhile';
@Component({
selector: 'my-rad-component',
})
export class MyComponent implements OnInit, OnDestroy {
@xtianjohns
xtianjohns / component_takeUntil.ts
Last active June 14, 2017 11:19
takeUntil for fun and for profit
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { MyService } from './MyService.ts';
import 'rxjs/add/operator/takeUntil';
@Component({
selector: 'my-rad-component',