EventBus used for implementing modapp's Model interface, Collection interface, and LocaleString interface.
With npm:
npm install modapp-eventbus --save
With yarn:
yarn add modapp-eventbus
import eventBus from 'modapp-eventbus';
let callback = data => {
console.log("data");
};
// Add event listener
eventBus.on('client.disconnect', cb);
// Emit an event
eventBus.emit('client.disconnect', /* data */ { foo: "bar" });
// Remove event listener
eventBus.off('client.disconnect', cb);