re-emitter

Re emit events from another emitter

MIT 10 个版本
安装
npm install re-emitter
yarn add re-emitter
pnpm add re-emitter
bun add re-emitter
README

re-emitter travis npm downloads javascript style guide

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.

版本列表
1.1.4 2019-06-28
1.1.3 2016-03-11
1.1.2 2016-02-24
1.1.1 2015-05-05
1.1.0 2015-04-08
1.0.0 2014-07-23
0.3.0 2012-12-07
0.2.0 2012-09-09
0.1.0 2012-08-30
0.0.1 2012-08-28