This package has been deprecated

Author message:

Migrated to @smikhalevski/event-bus

yaeb
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

yaeb build

Yet another event bus. There are many like it, but this one is mine.

The most primitive implementation of a push-based event bus (pub/sub) that you can find.

npm install yaeb
import {EventBus} from 'yaeb';

interface IFooEvent {
  foo: string;
}

const eventBus = new EventBus<IFooEvent>();

const unsubscribe = eventBus.subscribe((event) => console.log(event.foo));

eventBus.publish({foo: 'abc'}); // Outputs "abc" to console

unsubscribe();

Readme

Keywords

Package Sidebar

Install

npm i yaeb

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.69 kB

Total Files

8

Last publish

Collaborators

  • smikhalevski