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
More detailed explanation for function prepareInterface() #701
Comments
Here's a link to the article: http://learn.jquery.com/code-organization/deferreds/jquery-deferreds/ for ref. @timmywil @dmethvin @jaubourg Could you please take a look and suggest how to go about this? Thanks |
The example confuses me as well! It seems like you would not want to show the two sections until the data is filled, in which case the code should look like this? // Assume .news and .reactions are initially hidden
$.when(
getLatestNews(),
getLatestReactions()
).then(
prepareInterface
)
... The magic in function showAjaxedContent() {
return $( ".news, .reactions" ).slideDown( 500, function() {
$(this).addClass( "active" );
}).promise();
} |
@docahrens would the suggestion by @dmethvin solve your issue? Thanks |
Fixed in 9878874 |
The last example including the function prepareInterface() looks like a great example with lots to learn, but the explanation of the most difficult aspect of the example is lacking. In regard to prepareInterface(), it says:
"The application also has a function (prepareInterface()) which returns a promise to complete animating our containers for both the news and reactions."
It would be very useful to see a much more detailed explanation of what is happening in prepareInterface() and how it is useful. I am new to the idea of deferreds and promises, and unfortunately, it was not at all obvious to me what is happening in that method. Seems like a tutorial would be an excellent place for such an explanation...
The text was updated successfully, but these errors were encountered: