@most/dom-event
Version:
Streamlined DOM Events for most.js
40 lines (24 loc) • 968 B
Markdown
Streamlined DOM events for [@most/core](https://github.com/mostjs/core). Now you can write:
```js
import { click } from '@most/dom-event';
import { tap, runEffects } from "@most/core";
import { newDefaultScheduler } from "@most/scheduler";
const clickStream = click(el);
runEffects(tap(console.log, clickStream), newDefaultScheduler());
```
`npm install --save @most/dom-event`
See [the source](src/index.js) for all the supported event names. Each has the general signature:
```js
const stream = eventName(domNode, useCapture = false);
```
If there's an event type that isn't supported, you can use the general `domEvent` API:
```js
const stream = domEvent(eventName, domNode, useCapture = false);
```