@most/dom-event
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

most dom-event

Streamlined DOM events for @most/core. Now you can write:

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());

Install

npm install --save @most/dom-event

API

Events

<eventName> :: (EventTarget t, Event e) => t → boolean=false → Stream e

See the source for all the supported event names. Each has the general signature:

const stream = eventName(domNode, useCapture = false);

domEvent

domEvent :: (EventTarget t, Event e) => String → t → boolean=false → Stream e

If there's an event type that isn't supported, you can use the general domEvent API:

const stream = domEvent(eventName, domNode, useCapture = false);

Package Sidebar

Install

npm i @most/dom-event

Weekly Downloads

3,302

Version

2.2.0

License

MIT

Unpacked Size

59.6 kB

Total Files

10

Last publish

Collaborators

  • briancavalier
  • davidchase
  • most
  • tylors