Skip to content
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

Use type alias instead of interface for AxiosPromise #4505

Merged
merged 3 commits into from May 3, 2022

Conversation

phloose
Copy link
Contributor

@phloose phloose commented Mar 1, 2022

I propose to change the typing of AxiosPromise to be a type alias to the global Promise instead of an interface that extends it. This way it can be used as return type on async functions. With the current typing this is not possible because typescript complains that async functions must return the global Promise type.

Is there a rationale behind the current typing that i don't get?

@jasonsaayman
Copy link
Member

Cool, I cannot really see what the rational behind that was, seems to just have been the way the file was initially added to the project. It could be due to the way Axios promises used to work in the past, however I think it is safe to make this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants