with tap
you can perform side-effects when source emits, errors or completes
Open browser console to see the output
123456789101112const { 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()'));
See tap vs finalize comparison