tree: c14c54f9efd79f0b528d610edbdb8c27abda66be [path history] [tgz]
  1. test/
  2. .npmignore
  3. .travis.yml
  4. .zuul.yml
  5. index.js
  6. LICENSE
  7. package.json
  8. README.md
PoCs/nodejs_poc/node_modules/re-emitter/README.md

re-emitter travis npm downloads

Re emit events from another emitter

reemit

Sauce Test Status

Works in node and the browser with browserify.

js-standard-style

install

npm install re-emitter

usage

var reemit = require('re-emitter')

var emitter = new EventEmitter()
var other = new EventEmitter()

reemit(emitter, other, ['foo', 'bar'])

other.on('foo', function () {
  // foo will fire on other emitter!
})

emitter.emit('foo')

other.on('baz', function () {
  // baz will not fire on other emitter
})

emitter.emit('baz')

canceling re-emitting

reemit returns a function, which when called, cancels all re-emitting by removing the event listeners which it added.

contributors

  • Raynos
  • Feross

license

MIT. Copyright (c) Raynos.