Asynchronous JavaScript: promises to workers

8 steps · about 4 h 35 min · Intermediate

  1. Build a mental model of asynchrony (guide, MDN Web Docs, 30 min)

    Separate synchronous flow from delayed operations and callbacks.

  2. Compose work with promises (guide, MDN Web Docs, 35 min)

    Chain dependent operations and handle failures in one flow.

  3. Write async functions (guide, MDN Web Docs, 30 min)

    Express promise-based control flow with ordinary error handling.

  4. Fetch network data (guide, MDN Web Docs, 40 min)

    Send requests, inspect responses and handle HTTP failures.

  5. Cancel obsolete work (guide, MDN Web Docs, 25 min)

    Stop requests when a user navigates or changes intent.

  6. Process streamed results (guide, MDN Web Docs, 40 min)

    Handle data incrementally instead of waiting for a whole response.

  7. Move CPU work off the main thread (guide, MDN Web Docs, 40 min)

    Keep the interface responsive during expensive computation.

  8. Review promise patterns and pitfalls (guide, MDN Web Docs, 35 min)

    Avoid floating promises, nested chains and missing rejection paths.