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): fix cancelToken #2728

Merged
merged 5 commits into from Feb 16, 2023
Merged

fix(useAxios): fix cancelToken #2728

merged 5 commits into from Feb 16, 2023

Conversation

Alfred-Skyblue
Copy link
Member

@Alfred-Skyblue Alfred-Skyblue commented Feb 3, 2023

Description

fixed #2697
fixed #2392

After executing cancelToken.cancel to cancel the request, a cancelToken should be regenerated, otherwise the cancelToken of the next request will be the same as the previous cancelToken, causing the request to be canceled directly

Additional context

useAxios


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 Author

Alfred-Skyblue commented Feb 15, 2023

@antfu @wheatjs
I in the latest commit, when the request is executed continuously, the previous request will be automatically terminated to ensure that the obtained data is the latest request data. It was mentioned in the previous issues #2392, but it has been closed, and I have previously The same problem has been fixed in useFetch #2750

Copy link
Member

@wheatjs wheatjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

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