re-emitter
Re emit events from another emitter
Works in node and the browser with browserify.
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 () {
})
emitter.emit('foo')
other.on('baz', function () {
})
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
license
MIT. Copyright (c) Raynos.