Skip to content
Medium
Async/Await

Async result type

Type an async fetchUser that returns a typed user or throws; ensure call sites see Promise<User>. Add a catch block that narrows unknown errors.

Solution

Loading...
Run your code to see output and diagnostics.

Built by Antigravity. The source code is available on GitHub.