-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Type "AsyncReturnType" #167
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a real problem or use-case?
When we have an async function like this:
To get the return type, we currently have to do this:
type APIData = PromiseType<ReturnType<typeof getDataFromAPI>>
This is a bit hard to read IMO.
Describe a solution including usage in code example
If we had an utility Type that combines these two types called "AsyncReturnType", we could make it shorter and more readable like that:
type APIData = AsyncReturnType<typeof getDataFromAPI>
Who does this impact? Who is this for?
I think this would be beneficial for all people who want to get the return type of an async function.
The text was updated successfully, but these errors were encountered: