0.0.11 • Published 11 years ago

eventcenter v0.0.11

Weekly downloads
1
License
-
Repository
github
Last release
11 years ago

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

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago