Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asasugar/evenbus
✌Event bus js library based on publish/subscribe mode
https://github.com/asasugar/evenbus
event eventbus events plugin
Last synced: 1 day ago
JSON representation
✌Event bus js library based on publish/subscribe mode
- Host: GitHub
- URL: https://github.com/asasugar/evenbus
- Owner: asasugar
- Created: 2019-03-05T09:06:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-27T09:38:43.000Z (almost 3 years ago)
- Last Synced: 2024-11-13T00:53:40.195Z (3 days ago)
- Topics: event, eventbus, events, plugin
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# evenbus
[中文版](https://github.com/asasugar/evenBus/blob/master/README.zh-CN.md)
## plugin setup
```
npm install evenbus
or
yarn add evenbus
```## plugin use
```js
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 |