We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When we have an async function like this:
async function getDataFromAPI(){ return {a:1,b:2} }
To get the return type, we currently have to do this: type APIData = PromiseType<ReturnType<typeof getDataFromAPI>>
type APIData = PromiseType<ReturnType<typeof getDataFromAPI>>
This is a bit hard to read IMO.
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>
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:
No branches or pull requests
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: