waits

callback factory factory that proceeds when all callback

waits

callback factory factory that proceeds when all callback

npm install waits

var waits = require('waits');
 
var i = 0;
 
var fn = waits(next);
 
async(fn());
async(fn());
async(fn());
async(fn(function(x){
  i += x;
}));
 
function next(){
  console.log(i); // => 7 
}
 
function async(fn){
  setTimeout(fn, Math.random() * 1000, i++);
}

Factories a callback factory that will call next when all callback.

Returns the callback, optionally pass cb to handle results if needed.

To describe it you need to use 'factory' and 'callback' twice in a sentence. So, yes, it must be good.

MIT