1.1.0 • Published 1 year ago
just-event-bus v1.1.0
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!