I .promise() to show you .when() to use Deferreds
summary
Demonstrates seven concrete patterns using jQuery Deferreds: bundling three parallel Ajax sources with when to render a sidebar, storing a Deferred on page objects so some pages wait for data while others resolve immediately, a 10-line caching trick that saves a round trip by reusing a resolved Deferred, wrapping setTimeout as a Deferred-based wait, combining many animations with when.apply to return one Deferred, and using notify progress plus resolve/reject to track long tasks; code examples show these patterns working in practice.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:23alex.define()
- 2:31deferred history
- 6:05Bundling AJAX Calls
- 8:19Template Pattern
- 10:41Cache Money
- 12:38Pretty Syntax
- 15:34Arbitrary events
- 17:32Managing Animations
- 20:01Things I didn't ever mention but are still
- 22:56Deferred best practices
related talks
04mA Promise is a Promise
45mPromises — It Doesn't Have to Hurt
47mPromise-Based Architecture
27mThe Power of $q
41mNext Generation Asynchronous Patterns in JavaScript
49mA Beginner's Guide to Wrangling Asynchronicity in JavaScript
42mBeyond Promises: Async Patterns in JavaScript
30mParadigms for dealing with asynchrony
