Answers for "how to use tap()"

0

how to use tap()

content_copy
      
      
        open_in_new
      
      import { fromEvent } from 'rxjs';
import { tap, map } from 'rxjs/operators';

const clicks = fromEvent(document, 'click');
const positions = clicks.pipe(
  tap(ev => console.log(ev)),
  map(ev => ev.clientX),
);
positions.subscribe(x => console.log(x));
Posted by: Guest on May-17-2020

Browse Popular Code Answers by Language