0.0.0 • Published 11 years ago

all v0.0.0

Weekly downloads
2,857
License
-
Repository
github
Last release
11 years ago

all

callback when all callbacks have fired.

<img src=https://secure.travis-ci.org/dominictarr/all.png?branch=master>

var all = require('all')
var after = all(function () {
  console.log('done')
})

function doSomething(n, cb) {
  setTimeout(function () {
    console.log('N', n)
  }, Math.random() * 100)
}

doSomething(1, cb())
doSomething(2, cb())
doSomething(3, cb())
doSomething(4, cb())

License

MIT