Event manager available for node and browser applications.
npm install jaiminho
OR
bower install jaiminho
Just import dist/jaiminho.min.js in your html.
You can also import via AMD or CommonJS.
Create a Jaiminho instance:
var J = new Jaiminho();
function listener(arg) {
// your implementation
}
J.addListener('ModuleName', 'EventName', listener);
J.trigger('ModuleName', 'EventName', {
param1: 'foo',
param2: 'bar'
});
OR
J.trigger('ModuleName', 'EventName');
function listener(arg) {
// your implementation
}
J.removeListener('ModuleName', 'EventName', listener);
J.removeAllListeners('ModuleName', 'EventName');
J.getListeners('ModuleName', 'EventName');
J.getEvent('ModuleName', 'EventName');