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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    1

Package Sidebar

Install

npm i ah-batch

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • abelhabel