@uwu-codes/modapp-eventbus
v1.7.1
Published
EventBus used for implementing modapp's Model interface, Collection interface, and LocaleString interface.
Downloads
1
Readme
ModApp EventBus
EventBus used for implementing modapp's Model interface, Collection interface, and LocaleString interface.
Installation
With npm:
npm install modapp-eventbus --save
With yarn:
yarn add modapp-eventbus
Usage
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);