Node-compatible events for mostjs v2. For instance,
import { fromEvent } from 'most-from-event';
const watcher = fs.watch('./tmp');
const stream = fromEvent(watcher, 'change');
npm install --save most-from-event
Given an event emitter, return a stream of events:
const stream = fromEvent(eventName, emitter);
Same as above, but adds the stream gets the events first (uses prependListener
).