ah-batch
v1.0.2
Published
Batch functions and deal with them when they are all done
Downloads
10
Readme
###Usage
// instantiate a new Batch const batch = new Batch(); batch.add(function(next) { dbcall({}, function(err, result) { // handle err and result // and start next function call in the batch with next() next(result); }); }); // assign a final callback to deal with results when the batch is done batch.done = function(results) { // handle all results. results is an Array }; //start the batch batch.start();
####Arguments passed to the next() function will be passed to the final done() function.