0.2.0 • Published 3 years ago

laguagua v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

logo

Another typescript bus event.

Activity

License GitHub issues GitHub all releases GitHub Workflow Status npm

Why?

Why not.

Install

npm i laguagua --save

Usage

Import

import { laGuaGua } from 'laguagua';

Interface

Review and use to your implementations how the Laguagua interface looks

export interface ILaGuaGua {
  publish: (message: string, data?: Object) => void;
  subscribe: (message: string, trigger: Handler) => void;
  clear: () => void;
}

Publish

publish an event message.

bus.publish('bus::stop');

Subscribe

Subscribe into an event message.

const eventHandler = (message, data) => console.log(message);
bus.subscribe('bus::stop', eventHandler);

Clear

Clear all bus subscriptions.

bus.clear();
0.2.0

3 years ago

0.1.0

3 years ago