Functional event-emitter library for javascript. Each time you call a function on a current mimid, a new mimid is returned to the caller. This allows you to chain multiple emits and provides composability of event emitters.
yarn add mimid
or
npm add mimid
import mimid fromm 'mimid'
const emitter =
mimid()
.on("hello", () => console.log("hello there")
.on("goodbye", (data) => console.log(`Goodbye ${data})
emitter
.emit("hello")
.emit("goodbye", "Jim")
Create a new event emitter with the given event and its associated handler
Creates a new event emitter without the event in its listeners
Creates a new event emitter without any listeners
Emit an event to the subscribers to the current emitter and returns a new event emitter with the same listeners
Retrieves an array of listeners from the current event emitter