Skip to content
developez404Public

About

Another typescript bus event

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

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 as bus } 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();

About

Another typescript bus event

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages