TYPESCRIPT-BASICS5 MIN READ
Type the async return, not the await
Choose the correct return type for an async TypeScript function.
loadUser fetches a profile and returns either a cleaned User or null when the API returns 404.
Read the full lesson
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in