Skip to content

๐Ÿ‘œ Create a Callbag listenable source from events on a DOM node

License

Notifications You must be signed in to change notification settings

staltz/callbag-from-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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 ...

About

๐Ÿ‘œ Create a Callbag listenable source from events on a DOM node

Resources

License

Stars

Watchers

Forks

Packages

No packages published