Loading...

Promises, Promises: Unlocking the Power of jQuery's Deferreds - Brian Klaas

5,502 views

Loading...

Loading...

Transcript

The interactive transcript could not be loaded.

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Apr 25, 2014

Presented at jQuery Conference San Diego February 12-13, 2014
http://events.jquery.org/2014/san-diego/

February 12 2014 at 4:20PM PST in the Fundamentals Track

Description
Managing the order in which asynchronous callbacks in JavaScript occur can be a nasty business. Without a lot of overhead and management, you're never quite sure that a certain callback has succeeded or failed. One technique for handling this problem that has gained a lot of traction in the past year is to use deferreds and promises. In fact, if you're using jQuery 1.6 or later and making Ajax calls, you're already using deferreds and promises.

In this session, we'll look at how deferreds and promises bring order to the chaos of multiple asynchronous JavaScript calls -- often known as ""callback hell."" We'll start by understanding the problem of asynchronous work in JavaScript. The solution to this problem that jQuery provides are promises. A brief explanation of promises and deferreds will then be covered to give you a solid understanding of this key construct in JavaScript application development. We'll then look at the basics of both promises and deferreds in jQuery and then move on to see how you can leverage promises when making network requests, animating a page, loading content on the fly, waiting for long-running requests to complete, and more. Finally, we'll wrap up with a brief look at promises in other environments, like Node.js, and how promises are being integrated into the core JavaScript stack across browsers and virtual machines.

Slides: http://www.iterateme.com/blog/enclosu...

Loading...

When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...