Skip to content

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

Closed
wants to merge 16 commits into from

Conversation

gibson042
Copy link
Member

arthurvr and others added 16 commits April 9, 2015 20:59
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>
Copy link
Member

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.

Copy link
Member

@AurelioDeRosa AurelioDeRosa May 7, 2016

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?

Copy link
Member

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 ?

Copy link
Member Author

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.

Copy link
Member

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.

@dmethvin
Copy link
Member

dmethvin commented May 6, 2016

Other than the question about nomenclature, LGTM!

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

Successfully merging this pull request may close these issues.

6 participants