JavaScript with Promises
Managing Asynchronous Code
Seiten
2015
O'Reilly Media (Verlag)
978-1-4493-7321-4 (ISBN)
O'Reilly Media (Verlag)
978-1-4493-7321-4 (ISBN)
Asynchronous JavaScript is everywhere, whether you're using Ajax, AngularJS, Node.js, or WebRTC. This practical guide shows intermediate to advanced JavaScript developers how Promises can help you manage asynchronous code effectively-including the inevitable flood of callbacks as your codebase grows.
You'll learn the inner workings of Promises and ways to avoid difficulties and missteps when using them. The ability to asynchronously fetch data and load scripts in the browser broadens the capabilities of JavaScript applications. But if you don't understand how the async part works, you'll wind up with unpredictable code that's difficult to maintain.
This book is ideal whether you're new to Promises or want to expand your knowledge of this technology.
Topics include:
You'll learn the inner workings of Promises and ways to avoid difficulties and missteps when using them. The ability to asynchronously fetch data and load scripts in the browser broadens the capabilities of JavaScript applications. But if you don't understand how the async part works, you'll wind up with unpredictable code that's difficult to maintain.
This book is ideal whether you're new to Promises or want to expand your knowledge of this technology.
Topics include:
- Understand how async JavaScript works by delving into callbacks, the event loop, and threading
- Learn how Promises organize callbacks into discrete steps that are easier to read and maintain
- Examine scenarios you’ll encounter and techniques you can use when writing real-world applications
- Use features in the Bluebird library and jQuery to work with Promises
- Learn how the Promise API handles asynchronous errors
- Explore ECMAScript 6 language features that simplify Promise-related code
Daniel Parker is a software developer focused on web and mobile applications. He writes JavaScript for Evernote in Austin, Texas and is the organizer of the Austin Google Developer Group.
- Chapter 1Asynchronous JavaScript
- Callbacks
- Asynchronous JavaScript
- Run to Completion and the Event Loop
- Summary
- Chapter 2Introducing Promises
- Basic Usage
- Multiple Consumers
- Promise States
- Chaining Promises
- Callback Execution Order
- Basic Error Propagation
- The Promise API
- Summary
- Chapter 3Working with Standard Promises
- The Async Ripple Effect
- Conditional Logic
- Parallel Execution
- Sequential Execution Using Loops or Recursion
- Managing Latency
- Functional Composition
- Summary
- Chapter 4Using Libraries and Frameworks
- Promise Interoperability and Thenables
- The Bluebird Promise Library
- Promises in jQuery
- Summary
- Chapter 5Error Handling
- Rejecting Promises
- Passing Errors
- Unhandled Rejections
- Implementing try/catch/finally
- Using the Call Stack
- Summary
- Chapter 6Combining ECMAScript 6 Features with Promises
- Destructuring
- Arrow Functions
- Iterables and Iterators
- Generators
- Summary
Erscheint lt. Verlag | 14.7.2015 |
---|---|
Zusatzinfo | black & white illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 178 x 233 mm |
Gewicht | 166 g |
Einbandart | kartoniert |
Themenwelt | Informatik ► Web / Internet ► JavaScript |
Schlagworte | ECMAScript • Futures • JavaScript • Nebenläufigkeit • Parallele Programmierung • Promises • Webentwicklung |
ISBN-10 | 1-4493-7321-6 / 1449373216 |
ISBN-13 | 978-1-4493-7321-4 / 9781449373214 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
Mehr entdecken
aus dem Bereich
aus dem Bereich
Web-Programmierung leicht gemacht
Buch | Softcover (2024)
Rheinwerk (Verlag)
29,90 €