ah-batch

1.0.2 • Public • Published

###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.

Readme

Keywords

Package Sidebar

Install

npm i ah-batch

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • abelhabel