An event emitter that supports serial execution of asynchronous and synchronous event listeners. The call-chain can be interrupted, similar to the DOM's
This is a fork of async-eventemitter, with the following differences:
- Using emitter-component instead of EventEmitter
- Supports a variable number of arguments
firstmethods, as I consider those to be out of scope.
Because it supports regular (synchronous) listeners, it's a drop-in replacement for
var AsyncEventEmitter = ;var emitter = ;emitteremitter;
on || once(event, [data, ..], [next])
event. Asynchronous listeners should match the number of event arguments (2 in the example above).
emit(event, [data, ..], [done])
Executes all listeners for the event in order with the supplied data argument(s). The optional callback is called when all of the listeners are done, or if one of them returned an error.
emitSync(event, [data, ..])
Emit synchronously, like the regular
MIT © Andreas Hultgren, Vincent Weevers