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
Thanks for the report! The documentation for appyEach needs to be clarified a little. It's signature is (fns, ...args, callback). You can only omit callback if you don't pass anything for args. For example, you only called it with async.applyEach([ hello, hello]);. In this case, it will return a function with the signature (..args, callback).
In both cases, when calling the function returned by async.applyEach or calling async.applyEach with more than one argument, it will treat the final argument passed as callback. So, in the async.applyEach([ hello, hello ], 'test arg') case, test arg is being treated as callback, and args is empty.
The reason you are seeing a function being logged is because appyEach expects the functions passed in fns to be asynchronous, so they should have a callback as their last parameter. You'll notice that because of this, the callback you passed in your second example is never actually called because it's waiting for two hello functions to call the callback passed to it by appyEach, so they should actually be:
async.js: 2.0.1
node.js: 0.10.46
Sample code:
Expected result:
Actual result:
I read the doc for applyEach() a number of times and I don't know if I am doing something wrong. If I add a callback, then I get the expected result:
Result:
The text was updated successfully, but these errors were encountered: