/modapp-eventbus

EventBus used to implement with modapp's interfaces.

Primary LanguageJavaScriptMIT LicenseMIT

view on npm

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);

Documentation

Markdown documentation