busx

1.0.0 • Public • Published

Busx a easy JS eventbus

A eventbus to be easy to use and very small.

Install

  • Run npm install busx

Usage

Import Busx to any place of your application, where you can share the Busx intance

import Busx from 'busx'

Create a new instance

const bus = new Busx()

Available methods

  • (listen) This method await until the named event be dispatched

    bus.listen('event-name', data => { // Do wat you want })

  • (fire) This method dispatch a event

    bus.fire('event-name', data)

On the fire event the data parameter it's optional

  • (all) This method return all events registered on the instance

    bus.all()

Readme

Keywords

Package Sidebar

Install

npm i busx

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.07 kB

Total Files

10

Last publish

Collaborators

  • erikprogramador