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
Pass arguments to the first function in waterfall? #14
Comments
Define a dummy function that calls your function with the variables you need. LIke this:
|
Great hack =) |
An alternative is to use async.apply(authenticate, username, password) to bind the arguments up front. |
|
@adisos thanks! +1 |
Hmmm... Great hacks, really... I too was puzzled by not being able to pass parameters to first waterfall function... But, shouldn't this be post to module author (caolan) as a bug/inconsistency ? All the neatness of that method vanishes, with these hacks... :-/ |
This is the intended use of these methods. async.apply was added mainly for this use case AFAIK The documentation does give examples of using waterfall with a function, however, if anyone wants to amend the readme to show using waterfall with apply that would be fantastic |
👍 @adisos apply is great! i've only been using this library a little while and I am continually impressed. |
if anyone still has this issue, the constant function works very well.
For more info, check out http://caolan.github.io/async/docs.html#.constant |
It doesn't seem to be possible to pass arguments to the first function in waterfall.
Could this be done in other ways because I really need the first one to get some variables.
The text was updated successfully, but these errors were encountered: