Modern Asynchronous JavaScript (Pragmatic Bookshelf)

PragmaticBookshelf
Delve into async features of JavaScript from ES2020 through ESNext. Start building custom asynchronous iterators and generators, and more for fast, lean code.

Faraz K. Kelhini @Faraz

edited by Margaret Eldridge @Margaret

JavaScript today must interact with data-intensive APIs and networks. The solution is a program that can work asynchonously 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.


Faraz Kelhini is a technical author at LogRocket who is passionate about moving the web forward and promoting patterns and ideas that make coding more productive. With more than a decade of software development experience, Faraz has in-depth knowledge of the JavaScript language and its related APIs. You can follow him on Twitter at @FarazKelhini.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

21 1652 5

Latest Threads About This Book Top

Margaret
Ask Me Anything with Faraz K. Kelhini @Faraz On February 27 and 28, we are giving you a chance to ask questions of PragProg author Fa...
31 166 14
New
dhull
@Faraz The text after the code promise.allSettled/tracking_promises_ex02.js says, “In other words, this code will load the post sequenti...
0 403 0
New
ggarnier
In Aborting Multiple Fetch Requests with One Signal section, the code in abort/abort_ex09.js doesn’t show the downloaded images until Pro...
0 808 3
New
Margaret
Howdy readers! We’ve been offering Modern Asynchronous Javascript in beta for about a month now with no errata or other feedback to incor...
3 840 1
New
markjreed
Within the body of the asynchronous iterator, the code uses srcArr to refer to the array it’s being called on; since it’s a named functio...
0 758 1
New
PragmaticBookshelf
Delve into async features of JavaScript from ES2020 through ESNext. Start building custom asynchronous iterators and generators, and more...
21 1652 5
New

Most Active This Week Top

Most Active This Month Top

Margaret
Ask Me Anything with Faraz K. Kelhini @Faraz On February 27 and 28, we are giving you a chance to ask questions of PragProg author Fa...
31 166 14
New

Most Active This Year Top

Most Active Last Three Years Top

dhull
@Faraz The text after the code promise.allSettled/tracking_promises_ex02.js says, “In other words, this code will load the post sequenti...
0 403 0
New

Most Active Over Three Years Top

PragmaticBookshelf
Delve into async features of JavaScript from ES2020 through ESNext. Start building custom asynchronous iterators and generators, and more...
21 1652 5
New
ggarnier
In Aborting Multiple Fetch Requests with One Signal section, the code in abort/abort_ex09.js doesn’t show the downloaded images until Pro...
0 808 3
New
markjreed
Within the body of the asynchronous iterator, the code uses srcArr to refer to the array it’s being called on; since it’s a named functio...
0 758 1
New
Margaret
Howdy readers! We’ve been offering Modern Asynchronous Javascript in beta for about a month now with no errata or other feedback to incor...
3 840 1
New

Book Info

Publisher: Pragmatic Bookshelf

Are you this book's author? To be notified of all posts made about it, sign up an account then click here, then select 'watching' from the bell icon in the top right corner.

Get money off!

The Pragmatic Bookshelf

35% off any eBook

Simply use coupon code "devtalk.com" at checkout. See full details here.