auth-api/tests/node_modules/re-emitter
2021-06-23 22:30:45 +02:00
..
test Added some tests 2021-06-23 22:30:45 +02:00
.npmignore Added some tests 2021-06-23 22:30:45 +02:00
.travis.yml Added some tests 2021-06-23 22:30:45 +02:00
.zuul.yml Added some tests 2021-06-23 22:30:45 +02:00
index.js Added some tests 2021-06-23 22:30:45 +02:00
LICENSE Added some tests 2021-06-23 22:30:45 +02:00
package.json Added some tests 2021-06-23 22:30:45 +02:00
README.md Added some tests 2021-06-23 22:30:45 +02:00

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.