Skip to content

Instantly share code, notes, and snippets.

@riscie
Last active May 20, 2020 15:31
Show Gist options
  • Save riscie/228733ffcbe2fe37a2db02647ca8ba68 to your computer and use it in GitHub Desktop.
Save riscie/228733ffcbe2fe37a2db02647ca8ba68 to your computer and use it in GitHub Desktop.
rxjs 5 (before pipe) #angular #typescript
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime'; 
import 'rxjs/add/operator/distinctUntilChanged'; 
//import …
this.$someSubject 
.do(console.log)
.debounceTime(800) 
.map(value => parseFloat(value)) 
  .filter(value => !isNaN(value))
  .subscribe(result => {
  // …
  }) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment