Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 777 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 777 Bytes

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