Modern Asynchronous JavaScript
- Length: 143 pages
- Edition: 1
- Language: English
- Publisher: Pragmatic Bookshelf
- Publication Date: 2021-12-17
- ISBN-10: B09NQQ8715
- ISBN-13: 9781680509274
- Sales Rank: #0 (See Top 100 Books)
JavaScript today must interact with data-intensive APIs and networks. The solution is a program that can work asynchronously instead of finishing tasks in order. In modern JavaScript, instead of callbacks you’ll use promises to improve your application’s performance and responsiveness. JavaScript features introduced in ES2020, ES2021, and ESNext like Promise.allSettled(), Promise.any(), and top-level await help you develop small, fast, low-profile applications. With the AbortController API, cancel a pending async request before it has completed. Modern Asynchronous JavaScript gives you an arsenal of tools to build programs that always respond to user requests, recover quickly from difficult conditions, and deliver maximum performance.
Applications today must work with information on remote servers, and users expect a quick response to complex interactions at all times, whether on a high-speed 5G cellular network or slow public WiFi. JavaScript provides developers with advanced tools to coordinate the asynchronous parts of their code efficiently and deliver responsive programs. Faster applications equal happier users, which is the promise of asynchronous JavaScript.
With Modern Asynchronous JavaScript you’ll learn techniques for managing your async code. Features like ES2021 Promise.any() allow you to safeguard your async code from external issues that are out of your control like server downtime. You’ll discover secret weapons like top-level await to initialize resources, define dependency paths dynamically, and load dependencies with a fallback implementation. You’ll even learn to how to set a time limit for async requests and react if they take too long to complete.
Fast, reliable applications are a must in today’s world, where users demand increasingly greater amounts of data on mobile devices. Asynchronous programming may require more cautious planning than synchronous programming but the outcome is rewarding. Asynchronous JavaScript allows you to write code that is nimble but reliable, leading to programs that load faster, respond quicker, and most importantly that you can trust to function properly.
What You Need:
You’ll need an intermediate level of JavaScript programming skills and a browser that supports features from ES2020, ES2021, and ESNext.
Modern Asynchronous JavaScript About the Pragmatic Bookshelf Table of Contents Early Praise for Modern Asynchronous Java Script Acknowledgments Preface Who Is This Book For? What You Should Know What’s in This Book? Online Resources Introduction Demystifying Asynchronous Execution Working with Events Working with Callback Functions Introducing Promises Creating Settled Promises Handling Rejection Managing Multiple Concurrent Promises Chapter 1: Creating Custom Asynchronous Iterators Getting Ready Creating a Custom Iterator Creating a Custom Asynchronous Iterator Iterating over Async Iterables with for…await… of Detecting Whether an Object Is Iterable Wrapping Up Chapter 2: Enhancing Custom Iterators with Generators Getting Ready Using a Generator to Define a Custom Iterator Creating an Asynchronous Generator Iterating over Paginated Data Wrapping Up Chapter 3: Fetching Multiple Resources Getting Ready Executing Multiple Promises Using Promise.allSettled() to Fetch Multiple R esources Wrapping Up Chapter 4: Improving Reliability and Performance Getting Ready Using the Promise.any() Method Avoiding the Single Point of Failure Improving the Performance of Your App Wrapping Up Chapter 5: Setting a Time Limit for Async Tasks Getting Ready Comparing Promise.race() to Promise.any() Enforcing a Time Limit for Async Tasks Wrapping Up Chapter 6: Canceling Pending Async Requests Getting Ready Canceling Async Tasks After a Period of Time Handling an Aborted Request Removing Multiple Event Listeners Making a User-Cancelable Async Request Aborting Multiple Fetch Requests with One Sign al Wrapping Up Chapter 7: Accessing Promise Results from Another Module Getting Ready Using Top-Level await Putting Top-Level await to Work Wrapping Up Thank you for reading!
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.