package
Asynchronously emit event an event based on the arguments length.
npm install asyncemitGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
The asyncemit allows you to emit an event to an EventEmitter3 asynchronously.
The module is released in the public npm registry and can be installed using:
npm install --save asyncemitTo make this pattern work there are a couple of preconditions that need to be satisfied:
asyncemit method excluding the event
name.See the following example:
var EventEmitter = require('eventemitter3')
, asyncemit = require('asyncemit');
var ee = new EventEmitter();
ee.asyncemit = asyncemit;
//
// The next `foo` listeners will not be executed until `next` is called.
//
ee.on('foo', function (arg, next) {
// Do things with arg?
next();
});
//
// Still executed, but synchronously.
//
ee.on('foo', function (arg) {
});
ee.
3rdeden
npm@3rd-Eden.com