Asynchronous JavaScript: promises to workers
8 steps · about 4 h 35 min · Intermediate
- Build a mental model of asynchrony (guide, MDN Web Docs, 30 min)
Separate synchronous flow from delayed operations and callbacks.
- Compose work with promises (guide, MDN Web Docs, 35 min)
Chain dependent operations and handle failures in one flow.
- Write async functions (guide, MDN Web Docs, 30 min)
Express promise-based control flow with ordinary error handling.
- Fetch network data (guide, MDN Web Docs, 40 min)
Send requests, inspect responses and handle HTTP failures.
- Cancel obsolete work (guide, MDN Web Docs, 25 min)
Stop requests when a user navigates or changes intent.
- Process streamed results (guide, MDN Web Docs, 40 min)
Handle data incrementally instead of waiting for a whole response.
- Move CPU work off the main thread (guide, MDN Web Docs, 40 min)
Keep the interface responsive during expensive computation.
- Review promise patterns and pitfalls (guide, MDN Web Docs, 35 min)
Avoid floating promises, nested chains and missing rejection paths.