0.3.6 • Published 5 years ago

asynchronous-eventemitter v0.3.6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

asynchronous-eventemitter

Asynchronous version of EventEmitter, secured by promises

Build status Coverage status Dependency status Dev dependency status Issues Pull requests

Installation

$ npm install asynchronous-eventemitter

Doc

  • see node events documentation
  • fire "error" event if an error has thrown in an event listener
  • fire "looperror" event if an error has thrown in an "error" event listener
  • you can now chain "emit" events, the method return the class' pointer

Examples

Native

const Events = require("asynchronous-eventemitter");

new Events().on("error", (err) => {
  console.log(err);
}).on("test", (arg1, arg2, arg3) => {
  console.log(arg1, arg2, arg3);
}).emit("test", "arg1", "arg2", "arg3").emit("test2");

Typescript

import Events = require("asynchronous-eventemitter");

new Events().on("error", (err: Error) => {
  console.log(err);
}).on("test", (arg1: string, arg2: string, arg3: string) => {
  console.log(arg1, arg2, arg3);
}).emit("test", "arg1", "arg2", "arg3").emit("test2");

Tests

$ npm run-script tests

License

ISC

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

8 years ago