Book description
Orchestrating asynchronous function calls in JavaScript often leads to callback hell, but there is a reliable way to avoid this painful state of affairs. With this concise and simple guide, you’ll learn how to use jQuery deferreds and promises, an elegant approach for managing asynchronous calls in both client and server applications.
Publisher resources
Table of contents
- Preface
- 1. Introduction
- 2. The jQuery Deferred API
-
3. Deferred Recipes
- A Replacement for the setTimeout Function
- Messaging in Chrome Extensions
- Accessing Chrome Local Storage
- Running Promise-Returning Functions One by One
- A Promise Pool with an emptyPromise Method
- Displaying Google Maps
- Communicating with a Web Worker
- Using Web Sockets
- Automatically Retrying Failing Deferred Calls
- Memoization
- Short-Term Memoization of In-Progress Function Calls
- Streaming Promise Events
- Getting the First Result from a Set of Promises
- A Deferred Queue
- when2: An Improved jQuery.when
- Timing Out Promises
- Controlling Your Own Destiny
- Deactivating a Promise
- 4. More Time in the Mental Gymnasium
-
A. Hints for Selected Challenges
- A Replacement for the setTimeout Function
- Messaging in Chrome Extensions
- Accessing Chrome Local Storage
- Running Promise-Returning Functions One by One
- A Promise Pool with an emptyPromise Method
- Displaying Google Maps
- Communicating with a Web Worker
- Using Web Sockets
- Automatically Retrying Failing Deferred Calls
- Memoization
- Short-Term Memoization of In-Progress Function Calls
- Streaming Promise Events
- Getting the First Result from a Set of Promises
- A Deferred Queue
- when2: An Improved jQuery.when
- Timing Out Promises
- Controlling Your Own Destiny
- Deactivating a Promise
- B. The Promises/A+ Specification
- C. Converting an ArrayBuffer to Base 64
- Colophon
- Copyright
Product information
- Title: Learning jQuery Deferreds
- Author(s):
- Release date: December 2013
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449369392
You might also like
book
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Clean Code in JavaScript
Get the most out of JavaScript for building web applications through a series of patterns, techniques, …
book
Secrets of the JavaScript Ninja, Second Edition
Summary More than ever, the web is a universal platform for all types of applications, and …
book
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …
