3 function after(count, callback, err_cb) {
5 err_cb = err_cb || noop
8 return (count === 0) ? callback() : proxy
10 function proxy(err, result) {
11 if (proxy.count <= 0) {
12 throw new Error('after called too many times')
16 // after first error, rest are passed to err_cb
20 // future error callbacks will go to error handler
22 } else if (proxy.count === 0 && !bail) {
23 callback(null, result)