Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(useFetch): partial overwrite when {combination: 'overwrite'} #4430

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

Merged
merged 3 commits into from
Feb 15, 2025

Conversation

pkc918
Copy link
Contributor

@pkc918 pkc918 commented Dec 25, 2024

fix[#4092]

  options = {
    ...options,
    ...args[0],
    beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),
    afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),
    onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError),
  }

When args[0] does not have a beforeFetch, afterFetch, or onFetchError, the corresponding methods from options should be used instead.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 25, 2024
@OrbisK
Copy link
Collaborator

OrbisK commented Jan 17, 2025

Hey @pkc918. Can you please include relevant tests that fail without this PR but pass with it?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 24, 2025
@pkc918
Copy link
Contributor Author

pkc918 commented Jan 24, 2025

Hey @pkc918. Can you please include relevant tests that fail without this PR but pass with it?

@OrbisK Thanks for your review! I have added unit tests, but I have a question: should I add separate value for combination as a partial overwrite? Would that be more reasonable?

OrbisK
OrbisK previously approved these changes Jan 24, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 24, 2025
antfu
antfu previously approved these changes Feb 15, 2025
@antfu antfu dismissed stale reviews from OrbisK and themself via 08c283a February 15, 2025 07:37
@antfu antfu enabled auto-merge February 15, 2025 07:38
@antfu antfu disabled auto-merge February 15, 2025 09:08
@antfu antfu merged commit 3ca0d92 into vueuse:main Feb 15, 2025
6 of 8 checks passed
@pkc918 pkc918 deleted the useFetch branch February 17, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer needs test size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.