eventbus_js

1.0.1 • Public • Published

eventbus_js

simple event bus for node.js

how to use it.

import EventBus from 'eventbus_js';

var myGlobalEvtBus = new EventBus();

myGlobalEvtBus.subscribe("TODO_ADD_EVENT", function(obj){
    console.log(1, obj.done);
});

myGlobalEvtBus.subscribe("TODO_ADD_EVENT", function(obj){
    console.log(2, obj.title);
});

myGlobalEvtBus.publish("TODO_ADD_EVENT", {done:false, title:"write JS"})

Readme

Keywords

Package Sidebar

Install

npm i eventbus_js

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • nsisodiya