Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/staltz/callbag-from-event

👜 Create a Callbag listenable source from events on a DOM node
https://github.com/staltz/callbag-from-event

Last synced: about 2 months ago
JSON representation

👜 Create a Callbag listenable source from events on a DOM node

Awesome Lists containing this project

README

        

# 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 `` node.

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