-
Notifications
You must be signed in to change notification settings - Fork 264
jQuery.when: Document changes in 3.0 #922
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
Conversation
Fixes jquerygh-689 Closes jquerygh-711
Document changes that align the method to the Dataset API's behavior Fixes jquerygh-730 Closes jquerygh-758
</argument> | ||
</signature> | ||
<desc>Provides a way to execute callback functions based on one or more objects, usually <a href="/category/deferred-object/">Deferred</a> objects that represent asynchronous events.</desc> | ||
<longdesc> | ||
<p>If a single Deferred is passed to <code>jQuery.when()</code>, its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as <a href="/deferred.then/"><code>deferred.then</code></a>. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by <code>jQuery.ajax()</code> is a Promise-compatible object and can be used this way:</p> | ||
<p>If no arguments are provided, <code>jQuery.when()</code> will return a resolved Promise.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we need to create some other term than Promise
since what's returned here is a Deferred.promise
which is consumed a bit differently and has methods like .done
, etc. The types.xml
file does use Promise
for this but now that we consume ES6 Promise it's ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you @dmethvin. What if we start using the term jQuery Promise for our type, as we do for jqxhr, and Promise for ES6 Promises?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe jQuery-Promise
to make it clear it's a single term? What do you think @gibson042 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of a jQuery-specific term, but would like to keep that out of this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep no problem and I see you opened another issue. That lets this one continue on and we can return to figure out a good name.
Other than the question about nomenclature, LGTM! |
869d6a3
to
ee25a00
Compare
Ref jquery/jquery@356a3bc
Fixes gh-921