Learning jQuery Deferreds: Taming Callback Hell with Deferreds and Promises (Paperback)

Terry Jones, Nicholas H. Tollervey

  • 出版商: O'Reilly
  • 出版日期: 2014-02-04
  • 定價: $1,100
  • 售價: 8.0$880
  • 語言: 英文
  • 頁數: 132
  • 裝訂: Paperback
  • ISBN: 1449369391
  • ISBN-13: 9781449369392
  • 相關分類: jQuery
  • 立即出貨

買這商品的人也買了...

商品描述

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.

This book contains 18 examples that use deferreds to solve progressively challenging real-world programming problems, along with 75 stimulating puzzles (and their solutions) that will help you understand how and when to use deferreds. Experienced JavaScript programmers will learn new tricks in a fun way, and become immersed in the practice of event-based programming.

  • Understand the logic behind creating deferreds and returning promises
  • Get a structured explanation of jQuery’s deferred API
  • Delve into the dynamics of using deferreds
  • Explore a broad collection of useful deferred recipes developed by the authors
  • Gain hands-on experience by solving challenges that accompany each recipe
  • Go deeper into deferreds: encounter novel abstractions and mind-bending use cases

商品描述(中文翻譯)

在JavaScript中,協調異步函數調用通常會導致回調地獄,但有一種可靠的方法可以避免這種痛苦的情況。通過這本簡潔而簡單的指南,您將學習如何使用jQuery的deferreds和promises,在客戶端和服務器應用程序中管理異步調用的優雅方法。

本書包含18個例子,使用deferreds來解決日益具有挑戰性的現實世界編程問題,以及75個刺激性的謎題(及其解決方案),這將幫助您了解何時以及如何使用deferreds。有經驗的JavaScript程序員將以一種有趣的方式學到新的技巧,並深入研究基於事件的編程實踐。

- 理解創建deferreds和返回promises的邏輯
- 獲得對jQuery的deferred API的結構化解釋
- 深入探討使用deferreds的動態
- 探索作者開發的一系列有用的deferred配方
- 通過解決每個配方附帶的挑戰來獲得實踐經驗
- 深入研究deferreds:遇到新穎的抽象和令人費解的用例