-
Notifications
You must be signed in to change notification settings - Fork 4
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
Is there any way to use this when the callback isn't the last argument? #1
Comments
FYI - here is my code and my failing unit test |
Check the runAsync api: On Thursday, October 2, 2014, alan blount [email protected] wrote:
Arunoda Susiripala |
You can also do something like this.
(I didn't test this code, just wrote it here on github) |
@arunoda how about a third options argument to let users set the index of callback function? https://github.com/meteorhacks/meteor-async/blob/master/async.js#L31 |
Thanish solution works. Above api is having some bad design. So we don't need to optimize for that. On Thursday, October 2, 2014, Muhammed Thanish [email protected]
Arunoda Susiripala @arunoda http://twitter.com/arunoda |
I've read through the README, and this discovermeteor post, and the wrapAsync docs in Meteor core.
It works fine, when the "next" argument is the callback...
But take a look at this NPM method I'm trying to wrap:
https://github.com/moshen/node-googlemaps/blob/master/lib/googlemaps.js#L153
when I only pass in the
origin
anddestination
arguments, it works fine... when I do any others, it fails because the wrapAsync doesn't know where to pass in the callback.Suggestions?
The text was updated successfully, but these errors were encountered: