callbag-from-event
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

callbag-from-event

Create a callbag listenable source from events on a DOM node or a NodeJS Event Emitter.

npm install callbag-from-event

example

Create a listenable source of click events on the <body> node.

const fromEvent = require('callbag-from-event');
const forEach = require('callbag-for-each');
 
const source = fromEvent(document.body, 'click');
 
forEach(x => console.log(x))(source); // MouseEvent ...
                                      // MouseEvent ...

/callbag-from-event/

    Package Sidebar

    Install

    npm i callbag-from-event

    Weekly Downloads

    5,844

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    9.48 kB

    Total Files

    8

    Last publish

    Collaborators

    • staltz
    • zimme