Star

Created With


fromEvent



Creates a callbag source that emits given DOM events (or NodeJS event emitter).

1linkfunction fromEvent(target: EventTarget, name: string): Source<Event>

1link​import { fromEvent, subscribe, pipe } from 'callbag-common';

2link​

3link​pipe(

4link​ fromEvent(document, 'mousemove'),

5link​ subscribe(event => {

6link​ console.log(event.clientX + ', ' + event.clientY);

7link​ })

8link​);

147, 84 147, 85 148, 86 139, 88 ...
► Try It!



Home What Are Callbags?

Source Factorieschevron_right
Operatorschevron_right
Combinationchevron_right
Utilitieschevron_right