https://github.com/mouse484/wildeventemitter
Add wildcard to EventEmitter
https://github.com/mouse484/wildeventemitter
Last synced: 8 months ago
JSON representation
Add wildcard to EventEmitter
- Host: GitHub
- URL: https://github.com/mouse484/wildeventemitter
- Owner: mouse484
- License: mit
- Created: 2019-12-07T05:55:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-21T00:25:52.000Z (over 6 years ago)
- Last Synced: 2025-03-27T06:15:35.355Z (about 1 year ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WildEventEmitter
Add wildcard to EventEmitter
I'm not familiar with ts type definitions
Cannot be used with ts
# How to Use
### Install
```
npm install mouse484/WildEventEmitter
```
or
```
yarn add mouse484/WildEventEmitter
```
### coding
```js
const WildEventEmitter = require("WildEventEmitter");
const event = new WildEventEmitter();
event.on("*", (name, ...callback) => {
console.log(`name: ${name} |`, ...callback);
});
```
Look at the [sample](https://github.com/mouse484/WildEventEmitter/blob/master/sample.js)
# API
## new WildEventEmitter([EventEmitter]);
Extend EventEmitter to return WildEventEmitter that can use wildcar.
- `EventEmitter`(optional):Accept your EventEmitte, If not specified, empty EventEmitter is extended.