Skip to content
This repository was archived by the owner on Mar 5, 2019. It is now read-only.

DVS-devtools/js-eventbus

Repository files navigation

js-eventbus

[!!!] The source code of this package is on https://github.com/docomodigital/js-utils, this repository will be removed asap

Build Status Coverage Status npm version Greenkeeper badge

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-eventbus/latest

or run the following command inside the js-eventbus folder:

npm run doc:open

About

Simple library to trigger custom events

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •