codeql-action/node_modules/propagate
github-actions[bot] 0da815296a Update checked-in dependencies 2022-02-24 17:03:29 +00:00
..
tests update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
.eslintignore update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
.eslintrc.yml update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
.prettierignore update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
.prettierrc.yml update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
.travis.yml update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
LICENSE.md update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
README.md update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
index.js update @actions/tool-cache, install semver, nock 2020-06-18 16:31:13 +02:00
package.json Update checked-in dependencies 2022-02-24 17:03:29 +00:00

README.md

propagate

npm Build Status Coverage

Propagate events from one event emitter into another.

Install

$ npm install propagate

Propagate

var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
propagate(ee1, ee2)

ee2.on('event', function(a, b) {
  console.log('got propagated event', a, b)
})

ee1.emit('event', 'a', 'b')

Unpropagate

You can unpropagate by ending the propagation like this:

var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(ee1, ee2)

// ...

p.end()

Only propagate certain events:

var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(['event1', 'event2'], ee1, ee2)

Propagate certain events as other events:

var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(
  {
    event1: 'other-event1',
    event2: 'other-event2',
  },
  ee1,
  ee2
)

License

MIT