You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
I love the simplicity of your slide functions and I have a question about the implementation. I don't see a case where the cb_ function is called with an errState. It looks like the chain of callbacks is short circuited and cb_ is never invoked when there's an error. Is this by design or am I incorrect? I've commented the line in question below. Thanks! Great slides btw, very informative!
module.exports = asyncMap
function asyncMap (list, fn, cb_) {
var n = list.length
, results = []
, errState = null
function cb (er, data) {
if (errState) return
if (er) return cb(errState = er) //should this be cb_ ?
results.push(data)
if (-- n === 0)
return cb_(null, results)
}
if (list.length === 0) return cb_(null, [])
list.forEach(function (l) {
fn(l, cb)
})
}
The text was updated successfully, but these errors were encountered:
I love the simplicity of your slide functions and I have a question about the implementation. I don't see a case where the cb_ function is called with an errState. It looks like the chain of callbacks is short circuited and cb_ is never invoked when there's an error. Is this by design or am I incorrect? I've commented the line in question below. Thanks! Great slides btw, very informative!
The text was updated successfully, but these errors were encountered: