evenbus
v1.0.6
Published
Event bus js library based on publish/subscribe mode.
Downloads
2
Readme
evenbus
plugin setup
npm install evenbus
or
yarn add evenbus
plugin use
import EvenBus from "evenbus";
const evenbus = new EvenBus();
// AddListener
evenbus.on("events", msg => {
console.log(msg); // I am the event bus
});
// Emit
evenbus.emit("events", "I am the event bus"); // Parameter type is all types.
// remove
evenbus.remove("events"); // Remove specified listener
evenbus.remove(); // Remove all listener
Props type
| Prop | Type | Defaults | Required | Description | | :----------- | :----- | :--------- | :--------- | -------------------------- | | maxListeners | Number | 10 | × | Maximum number of monitors |