bus-event

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i bus-event

Weekly Downloads

5

Version

1.0.0

License

ISC

Unpacked Size

5.69 kB

Total Files

4

Last publish

Collaborators

  • hashemirafsan