1.2.1 • Published 3 months ago

tiny-b v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Installation

yarn add tiny-b

Usage

import TinyBus from "tiny-b";

const tinyBus = new TinyBus(/* options */);

const subscriberId = await tinyBus.on("my-event::v1", {
  onCallback: (subscriberId, context, ...args) => {
    console.log("My event", { subscriberId, context, args });
  },
});

await tinyBus.emit("my-event::v1", { foo: "bar" });

FAQ

What is an event bus?

An event bus is a mechanism that allows different parts of an application to communicate with each other without knowing about each other. It is a publish/subscribe system where the publisher of an event (the producer) does not send it directly to the receiver (the consumer), but instead sends it to an event bus. The event bus then distributes the event to all interested consumers.

Why another event bus?

There are many event bus implementations out there, but TinyBus is different. Starting from the fact that it is tiny and has almost no dependencies, it also supports different dispatching strategies, event deduplication and retrying failed events out of the box.

1.2.1

3 months ago

1.2.0

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.0.0

4 months ago