A simple way to chain events and control program flow asynchronously.
This is an open source project under the MIT license, see LICENSE.md for additional information.
npm install --save event-chain
var chain = ;var example = chain;example;example;// foo to console.
Debugging is made possible with Debug and can be enabled by setting the
/*** Create an event-chain that will execute the callback after all the events have been emitted.** @param events* An array of events (string) that are required before invoking the callback.* @param callback* A callback function to be executed after all the provided events have been fired.** @return* A Chain object.*/chain
/*** Emit the given event for the chain.** @param event* Emit an event that was previously registered with chain.on();*/foo;
Customized options are available for the chain.
var chain = options;
The event that is fired once all user-defined events have completed, used internally. Default: '__complete'