@evodev/eventemitter
v1.0.7
Published
An EventEmitter made by EvoDev
Downloads
6
Readme
EventEmitter
is an object/method which triggers an event as soon as some action takes place so as to pass the cntrol to the parent function.
Usage
EventEmitter#on(event, callback)
To add new callback function with
event
as name. It will return an ID as identity.
EventEmitter#emit(event)
To emit functions those have
event
as name.
EventEmitter#off(id)
To delete a function that have
id
as ID.
EventEmitter#get(name)
To get an event data with
name
as name.
Example
const EE = require("@evodev/eventemitter");
const ee = new EE();
let ids = [];
ids.push(ee.once("lol", () => 10*1));
console.log(ee.emit("lol")); //["lol"]
console.log(ee.emit("lol")); //false
Support
Developer
- Gaia#7541 (Discord)
Donation
- PayPal: nekomaru76