@docomodigital/js-eventbus

4.0.4 • Public • Published

js-eventbus

npm version

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:

http://docomodigital.github.io/js-utils/js-eventbus/latest

Readme

Keywords

none

Package Sidebar

Install

npm i @docomodigital/js-eventbus

Weekly Downloads

22

Version

4.0.4

License

MIT

Unpacked Size

24.1 kB

Total Files

10

Last publish

Collaborators

  • everdrone
  • blame_etc