Tools

The idea with this section is to list nice tools that helps you when writing RxJS code

RxJS DevTools

Found on github link https://github.com/kwintenp/rx-devtools The README lists how to install the the npm/ yarn module and also the chrome plugin.

Very nice tool for visualising what your code does and what values will be emitted.

Here is a code on how to run it inside of an Angular project:

  1. import { Observable } from 'rxjs/Observable';
  2. import 'rxjs/add/operator/filter';
  3. import 'rxjs/add/operator/map';
  4. import 'rxjs/add/operator/take';
  5. export class AppComponent {
  6. constructor() {
  7. const interval$ = Observable.interval(1000)
  8. .debug('test map')
  9. .startWith(10)
  10. .take(10)
  11. .filter((val: number) => val % 2 > 0)
  12. .map((val: number) => val * 2)
  13. .subscribe();
  14. }
  15. }

RxFiddle

Just go to the page http://rxfiddle.net/#type=editor and start writing your RxJS expressions. It will show you a visual of what a run looks like. It doesn’t get any simpler.