event-done
Extension of EventEmitter which allows to pass callback that will be invoked when all listeners completed
Usage
- We can have multiple listeners attached to the same event, but final callback will be called only oncevar EventDone = EventDone;var event = ;event;event;event;event;
- Let's assume that one of listeners did not call it's callback. In this case final callback will be called with error of type EventDoneTimeoutErrorvar EventDone = EventDone;var EventDoneTimeoutError = EventDoneTimeoutError;timeout = 100;console;var event = ;event;event;event;
- In case of any listener fails, final callback is instantly called with that errorvar EventDone = EventDone;var event = ;event;event;event;