1.0.7 • Published 4 years ago

@evodev/eventemitter v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago