1.0.1 • Published 10 years ago
event-bulk-attach v1.0.1
event-bulk-attach
Attach events to a listener in bulk. Creates an event emitter if none is provided.
Installation
$ npm install event-bulk-attach
Usage
const EventEmitter = require('events').EventEmitter
const attach = require('event-bulk-attach')
const events = {
foo: [barFn, binFn],
err: [errFn, blaFn],
oii: beepFn
}
const emitter = attach(new EventEmitter(), events)
emitter.emit('foo')
// barFn & binFn are called
See Also
- event-aggregate - event multiplexer