callbag-from-event

v1.3.0
Create a callbag listenable source from events on a DOM node
callbag

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 ...
npm i callbag-from-event

Metadata

  • MIT
  • Whatever
  • staltz.com
  • released 2/24/2020

Downloads

Maintainers