Skip to content
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

What about .call/.apply? #28

Open
natevw opened this issue Jan 31, 2013 · 0 comments
Open

What about .call/.apply? #28

natevw opened this issue Jan 31, 2013 · 0 comments

Comments

@natevw
Copy link
Owner

natevw commented Jan 31, 2013

Consider this code:

queue()
    .defer(api.db.doc1.get)
    .defer(api.calculator.post, "sin(2.71828182846)")
.await(function (e, thing1, thing2) {
   console.log(e, thing1.number + thing2.result);
});

In this case, the queue code must .apply our arguments to our "functions". But our URL instances do not support call/apply — call(ctx, arg, cb) might issue an HTTP "CALL" request at best, and apply() just extends the URL oddly!

I wonder if it'd work to have () return a String object instead of a primitive string — then we could assign its own call/apply properties and the code would be rewritten like so:

.defer(api.calculator.post(), "sin(2.71828182846)")

Kinda odd/hacky, but not sure a better way to support this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant