1.0.0 • Published 6 years ago

bus-event v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

bus-event

bus-event is a simple package for passing easily your event.

Installation

npm install bus-event

or

yarn add bus-event

Usage

Just import the package before start using it.

As a ES6 Module:

import BusEvent from 'bus-event';

Methods

Now here we have two methods to complete our work.

$emit(key, params)

When you will fire your event by bus event.

BusEvent.$emit('some_key', {
    // something 
})

$on(key, callback)

When you will receive your event by bus event.

BusEvent.$on('some_key', (e) => {
    // something
})

Bugs and Issues

If you encounter any bugs or issues, feel free to open an issue at github.