Skip to content

viRingbells/await-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

await-events

NPM version build status Test coverage

Events that provides method await wait till an event occurred. Inspired by await-event

Install

$ npm install --save await-events

Usage

const AwaitEvents = require('await-events');

// usage 1:
emitter.await = AwaitEvents.await;

// usage 2:
class MyEventEmitter extends AwaitEvents

then:

await emitter.await('event');

if error event occurred, it throws the error. You can do await emitter.await('event', 'exception') to change error event name. You can also use AwaitEvent.await(emitter, 'event') instead of binding a method on emitter

About

Events that provides method `await` wait till an event occurred. Inspired by `await-event`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published