- Notifications
You must be signed in to change notification settings - Fork262
Document jQuery.ready as Promise-consumable#530
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
entries/jQuery.ready.promise.xml Outdated
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.
In the standards sense, it doesn't provide a Promise interface but instead a thenable one. This has been one of the reasons we've been hesitant to document this. The other is that we may try to make jQuery.Deferred optional in a future version, so it's almost as if we're documenting and deprecating this at the same time.
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 understand it isn't a standards Promise (the definition of that seems still in flux, too), I just tried to match our terminology from elsewhere. What should this be called?
deferred.promise:"type=Promise", "Return a Deferred's Promise object.", "The Promise exposes only the Deferred methods needed to attach additional handlers or determine the state"- Types:"Promise Object", "a subset of the methods of the Deferred object"
promise:"a Promise object to observe when all [actions] have finished"
dmethvin commentedJul 15, 2014
The |
Krinkle commentedJul 15, 2014
The |
Also:* Categorise jQuery.holdReady in events/document-loading, to match ready() and jQuery.ready.promise().* Categorise jQuery.holdReady in properties/global-jquery-object-properties, to match jQuery.fx.off() and jQuery.ready.promise().Fixes#205
dmethvin commentedJul 16, 2014
Agreed, |
gnarf commentedDec 21, 2014
I actually think it might be as easy as |
gnarf commentedDec 22, 2014
@Krinkle I don't think we want to document the |
jaubourg commentedDec 22, 2014
$.when($.ajax(templateURL),$.ajax(dataURL),$.ready).then(function(template,data){$("#target").html(applyTemplate(template[0],data[0]));}); This is how you decouple initialization code while enabling preemptive asynchronous operations and keeping everything readable. Having a |
dmethvin commentedDec 22, 2014
Yes, the ready promise is nice to use. Two issues with it:
Edit by@gnarf - made into checkboxes |
gnarf commentedDec 22, 2014
Okay,
|
gnarf commentedDec 22, 2014
|
AurelioDeRosa commentedNov 15, 2015
Is this PR still relevant? It's more than a year old. |
agcolom commentedJan 27, 2016
@timmywil Could you please check this? Thanks (old PR). |
timmywil commentedJan 28, 2016
Oh, sorry. It depends on the resolution of the ticket@gnarf linked. I guess it's been longer than I thought, but we finally have aPR for it. I'm on the fence about whether it's worth the bytes. If we merge the PR, |
gnarf commentedFeb 3, 2016
Thenable?
|
timmywil commentedFeb 3, 2016
It looks like we will be getting rid of |
tdelmas commentedJun 9, 2016
Shouldn't that pull request be merged?https://jquery.com/upgrade-guide/3.0/ says that "Feature: jQuery.ready promise is formally supported" but I don't see it onhttps://api.jquery.com |
timmywil commentedJun 9, 2016
The PR needs updating first. |
mgol commentedJul 13, 2016
jquery/jquery#1778 has been fixed so this PR should no longer be blocked. |
dmethvin commentedAug 12, 2016
@Krinkle With jQuery 3.0 we're exposing Would you like to update this PR to reflect those changes? It would be great to get that done! |
Krinkle commentedSep 20, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also:
jQuery.holdReadyin events/document-loading,to match
ready()andjQuery.ready.promise().jQuery.holdReadyin properties/global-jquery-object-properties,to match
jQuery.fx.off()andjQuery.ready.promise().Fixes#205