Async code — TypeScript · Foundations

A server waits on everything: databases, other services, timers. Run independent work at the same time, collect results whether each succeeded or not, give up after a deadline, and try again after a failure, with types that say what each promise carries.

What you will learn

Read the theory for Async code

All TypeScript lessons

All Foundations courses

loading types…

What you'll learn

  • Write async functions and type what their promises carry
  • Run independent work at once with Promise.all, and keep going past failures with Promise.allSettled
  • Race a promise against a timer, and retry a failing operation with try and catch around await