just-event-bus

1.1.0 • Public • Published

Simple Event Bus for javascript that just works

const fn = (text) => console.log(text);
EventBus.on("foo", fn);

EventBus.emit("foo", "Hello World!"); // => Hello World!

Also it supports arrays:

const fn = (text) => console.log(text);
EventBus.on(["foo", "bar"], [fn]);

EventBus.emit("foo", "Hello!"); // => Hello!
EventBus.emit("bar", "World!"); // => World!

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i just-event-bus

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    6.11 kB

    Total Files

    7

    Last publish

    Collaborators

    • proton2