Created
July 30, 2024 21:41
-
-
Save wealthfront-data-fetching-blog-post/95ee689e987639cba31e3eca9562e230 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface User { | |
name: string; | |
} | |
const api = { | |
getUser: (userId: number) => { | |
return new Promise<User>((resolve) => { | |
resolve({ | |
name: 'Elan', | |
}); | |
}); | |
}, | |
}; | |
const user = await api.getUser(userId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment