Learn JavaScript

Lesson 3 of 9 · Async 2: Promises, async/await and fetch

Module 13 · Async 2: Promises, async/await and fetch

Full Programs: A Fetcher, a Timeout, a Retry, a Progress Loader and a Pool

Free with an accountReading

The last two lessons showed each method on its own. Real code combines them. A page that loads data needs a timeout, because servers hang. It needs a retry, because networks drop. It needs a progress report, because people wait. And it needs a limit, because a server refuses a thousand requests at once.

Checking what this lesson needs for you…

What is inside Full Programs: A Fetcher, a Timeout, a Retry, a Progress Loader and a Pool

  1. The fetch every program here shares
  2. Three requests in a row
  3. The same three, together
  4. A timeout with race
  5. A retry with backoff
  6. A progress loader with allSettled
  7. A pool that runs k at a time
  8. One promise for many callers