event-bulk-attach

1.0.1 • Public • Published

event-bulk-attach

NPM version build status Test coverage Downloads js-standard-style

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

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.11latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.11
1.0.01

Package Sidebar

Install

npm i event-bulk-attach

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • yoshuawuyts