Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (30 sloc) 704 Bytes

Do sideeffects on source emissions.
(Open browser console to see the output)

const { rxObserver } = require('api/v0.3');
const { timer } = require('rxjs');
const { tap, take } = require('rxjs/operators');

timer(0, 5)
  .pipe(
    take(10),
    tap(v => console.log('tap', v))
  )
  .subscribe(rxObserver('tap()'));

rxjs-compat version with .do:

const { rxObserver } = require('api/v0.3');
const { Observable } = require('rxjs/Rx');
Observable
  .timer(0, 5)
  .take(10)
  .do(v => console.log('do', v))
  .subscribe(rxObserver('.do()'));
You can’t perform that action at this time.