@keneanung/nexus-event-bus
TypeScript icon, indicating that this package has built-in type declarations

0.5.11 • Public • Published

Iron Realms Nexus Event Bus

An implementation of the publish-subscriber pattern at its core.

Installation

To install the package, first download it to your machine via this link.

You can then proceed to install it as a normal package into your Nexus profile. You may have to log in and out after installing the package.

Basic Usage

When the package is installed, you can use it in any script reflex. First you will need to subscribe to an event.

eventBus.subscribe('myEvent', (data) => {
  console.log(data);
});

To raise an event, you can use the raise method.

eventBus.raise('myEvent', 'Hello World!');

This will print Hello World! to the console.

For documentation on the inidividual methods, advanced usage and some best practices, see the Nexus Event Bus documentation.

/@keneanung/nexus-event-bus/

    Package Sidebar

    Install

    npm i @keneanung/nexus-event-bus

    Weekly Downloads

    1

    Version

    0.5.11

    License

    MIT

    Unpacked Size

    20.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • keneanung