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

fix(useAxios)!: error should return type unknown #2807

Merged
merged 5 commits into from Mar 4, 2023
Merged

Conversation

jbaubree
Copy link
Contributor

Warning: ⚠️ Slowing down new functions

Due to the growing audience of VueUse, we received a huge amount of feature requests and pull requests. It's become harder and harder and recently a bit beyond our capacity to maintain the project. In the near future, we could like slowing down on accepting new features and prioritize the stability and quality of existing functions. New functions to VueUse may not be accpected. If you come up some new ideas, we advice you to have them in your codebase first instead of proposing to VueUse. You may iterate them a few time and see how them suite your needs and how them can be generalized. If you really believe they are useful to the community, you can create PR with your usercases, we are still happy to hear and discuss. Thank you for your understanding.

Description

fix(useAxios): add typing for onError param

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Alfred-Skyblue
Copy link
Member

In the response interceptor, what we throw out is not necessarily AxiosError type.

@jbaubree
Copy link
Contributor Author

@Alfred-Skyblue i don't understand why error is typed with AxiosError ?
Capture d’écran 2023-02-23 à 09 01 04

@antfu
Copy link
Member

antfu commented Feb 24, 2023

Yeah, I think instead, the return error ref should be typed as unknown

@antfu antfu added this to the 10.0 milestone Feb 24, 2023
@antfu antfu changed the title fix(useAxios): add typing for onError param fix(useAxios): error should return type unknown Mar 2, 2023
antfu
antfu previously approved these changes Mar 2, 2023
@antfu antfu changed the title fix(useAxios): error should return type unknown fix(useAxios)!: error should return type unknown Mar 2, 2023
@antfu antfu merged commit d8d732e into vueuse:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants