Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.



Programming and Learning from SD

I learned some new things about $.when.apply that were worth sharing.

http://jsfiddle.net/logankd/s5dacgb3/

· the first reject will fire the .always, but not the .then

· .then won’t fire until all promises are resolved (or one is rejected)

Maybe not new to you, but I had to try it out after seeing the last answer at http://stackoverflow.com/questions/14777031/what-does-when-apply-somearray-do

EDIT: I was playing with this again and made a different, simplified playground on codepen. 11/13/15

EDIT 2: With some guidance from my friends, I can recover from one failed request and still return something so I can show one result in the list. http://codepen.io/logankd/pen/dYwjvW?editors=001

Posted on Friday, January 30, 2015 7:53 PM JavaScript | Back to top


Comments on this post: When does $.when.apply resolve the promises?

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net