JavaScript Promises: Thinking Sync in an Async World




This talk about JavaScript Promises was delivered by Kerrick Long at the STL Ember.js Meetup on Feb 6, 2014. Slides: https://speakerdeck.com/kerrick/javascript-promises-thinking-sync-in-an-async-world

Original source


18 responses to “JavaScript Promises: Thinking Sync in an Async World”

  1. great talk but you need to buy Camtasia and use its tools to get rid of the background noise and to bring your voice up higher. Buy it, it's worth it.

    What did you say at 11:39, "doesn't matter if the promise is fulFilled, you do know have to do attach….????" can you fill in the blank there, it was said quick and hard to hear

    What did you say at 12:55 "if you ever write your own code….?? data"

  2. Excellent presentation and the 'white noise' did not bother me.  In fact the layout should be a model for other Youtube videos:  when slides are on the screen, the speaker's head is in a corner and no more than 5% of screen space.

    The examples are clear and mostly 7 lines of code or fewer per slide.

  3. Regarding the question at 12:00 :
    From the Promises/A+ specification:
    "then may be called multiple times on the same promise.
    If/when promise is fulfilled, all respective onFulfilled callbacks must execute in the order of their originating calls to then.
    If/when promise is rejected, all respective onRejected callbacks must execute in the order of their originating calls to then."
    here is the link: http://promisesaplus.com/#point-36

  4. Thank you for this very helpful guide. 
    But I have a question about why should we bind console in the below code:
    getJSON('/comments')
      .then(function(comments){throw new Error('Hello?')})
      .catch(console.error.bind(console))
    What's happening here?
    Sometimes, when I use console.error as a callback , for example , response.on('error', console.error), I won't need a bind. 
    Plus, why can anonymous function that wraps up console.error solve this problem?
    Thanks!

Leave a Reply