Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Propagate events from one event emitter into another
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
.gitignore
README.md
index.js
package.json

README.md

propagate

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);

License

MIT

Something went wrong with that request. Please try again.