Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
LICENSE
README.md
index.js
package.json

README.md

eventcenter

How to use

var events      = require('events'),
    eventcenter = require('eventcenter');

// Some emitter
var e = new events.EventEmitter();

// When a hello event fires
e.on('hello', function(){
    console.log('hello event emitted');
});

// When a world event fires
e.on('world', function(){
    console.log('world event emitted');
});

eventcenter.connect(e, ['world', 'hello'] );

// Whenever an event fires (any event)
eventcenter.on('event', function( e ){
    console.log('The eventcenter reports on the event: ' + e.event, e.data);
});


e.emit('hello');
e.emit('world');

API

eventcenter.connect( eventEmitter, eventsArray, namespace )

Listens to all events an instance of EventEmitter fires, then reports on those fired events

Something went wrong with that request. Please try again.