Beta (still building)

fromEvent

fromEvent operator Converts Event to observable stream

Example: fromEvent Operator with mouse click

This example you need click in the page:

import { fromEvent } from 'rxjs';

const clicks$ = fromEvent(document, 'click');

Example: fromEvent Operator with keyboard

press the keyboard

import { fromEvent } from 'rxjs';
import { map } from 'rxjs/operators';

const keyDown$ = fromEvent(document, "keydown")
  .pipe(map(e => e.key));


Official Doc: rxjs.fromEvent