-
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
Single- versus multi-param factory #19
Comments
I argue for 1, despite extensibility concerns.
|
I like 1 as well. Both |
In YUI we're going for I like |
Let's do |
I like 1. Your suggestion for cancellation misses the point slightly, you're shouldn't be doing cancellation from the resolver/factory, you should be handling it and canceling the underlying operation. function get(url) {
return new Promise(function (resolve, reject, progress, onCancelled) {
var xhr = getXHRObject();
onCancelled(function () {
xhr.abort();
});
xhr.onProgress = progress;
//other xhr stuff
});
} Personally, the way I see it, we're going to add progress to then, we may as well add progress and cancellation to this, that's only 4 arguments. I can't see any reason we'd ever need a fith, so 4 seems fine. |
Seems like we have consensus on 1, so, closing. @ForbesLindesay: I don't think adding progress to |
I'd be fine with that too. The point I was making is that I don't think cancellation needs to be possible for anyone who's not got access to the promise, so they can just do |
This is somewhat of a rehash of #7, but it's in the context of the latest strawman (#18).
Basically, the choices for parameters to
factory
are:resolve
+reject
resolver
+resolver.reject
resolve
andreject
propertiesAnd the reason for choosing 2 or 3 over 1 is future extensibility.
The text was updated successfully, but these errors were encountered: