js-eventbus
Simple library to trigger custom events
Usage
import EventBus from '@docomodigital/js-eventbus';
const Bus = new EventBus();
const callback = (options) => {
console.log(options.foo);
};
Bus.on('customEvent', callback);
Bus.trigger('customEvent', { foo: 'bar' }); // console.log('bar')
Installation
NPM
npm install --save js-eventbus
Documentation
To read documentation, go to: