x-event
v1.0.0
Published
Event class (observer pattern).
Downloads
8
Readme
Event
Event is a JavaScript library providing observer pattern implementation.
Examples
var Event = require('x-event');
var myEvent = new Event();
myEvent.addListener(function(message) {
console.log(message);
});
myEvent.notifyListeners('my message');
Method aliases
addListener - add, subscribe.
removeListener - remove, unsubscribe.
notifyListeners - emit, publish, trigger.
Installation
npm install --save x-event