most-from-event
v1.1.2
Published
Node events for most.js
Downloads
8
Maintainers
Readme
most from-event
Node-compatible events for mostjs v2. For instance,
import { fromEvent } from 'most-from-event';
const watcher = fs.watch('./tmp');
const stream = fromEvent(watcher, 'change');
Install
npm install --save most-from-event
API
fromEvent
fromEvent :: (Emitter emt, Event e) => String -> emt -> Stream e
Given an event emitter, return a stream of events:
const stream = fromEvent(eventName, emitter);
fromEventPrepended
fromEventPrepended :: (Emitter emt, Event e) => String -> emt -> Stream e
Same as above, but adds the stream gets the events first (uses prependListener
).