event-bus

Simple Event Bus library for event management.

Installation

npm i @savalazic/event-bus

API

addEventListener

// @event - string
// @callback - function
EventBus.addEventListener(event, callback);

removeEventListener

// @event - string
// @callback - function
EventBus.removeEventListener(event, callback);

dispatchEvent

// @event - string
// @detail (optional) - object
EventBus.dispatchEvent(event, detail);

Example

All examples

Licence

event-bus is released under the MIT license. Copyright © 2018 Sava Lazic.