-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async.during iteratee callback do not support optional parameter #1217
Comments
This does same with |
Which 2.0.0 RC version are you using? |
@aearly 6 |
Any arguments you pass to callback will be passed to the predicate. Your code can be changed as follows, var count = 0;
async.during(
function (callback) {
return arguments[arguments.length - 1](null, count < 5);
},
function (callback) {
count++;
setTimeout(function(){
callback(null, count);
}, 1000);
},
function (err) {
// 5 seconds have passed
console.log("done")
}
); This probably should be documented, if you're interested send a pull request |
@aearly do we want to just remove optional parameters passed to during test functions? Doesn't seem so useful as async won't pass it in on the first call anyway (always undefined first run) I'd vote scrap the extra args |
|
I think we should just remove this behaviour |
Should we also remove the behavior for |
I think so (never found it anything but weird) but I'd like to hear anyones On Fri, Jul 8, 2016 at 1:21 AM, Alex Early [email protected] wrote:
|
I am using v2.0.0 on client side.
In async.during example, if we pass a optional value in callback of iterate, javascript show error of
callback is not a function
in truthy functon.Is there anything I am doing wrong? I guess this is also mentioned in documentation that
callback
will be passed an error and any arguments passed to the finalfn
's callbackThe text was updated successfully, but these errors were encountered: