Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt): refresh override for data fetching composables #7864

Merged
merged 5 commits into from Oct 10, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14746, resolves nuxt/nuxt#13300

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This adds an override option to force override previous async data calls. With useFetch, we additionally use AbortController (if available in user's target) to cancel the fetch request. Either way, previous async data calls do not affect pending state or resolved data, and any promises returned by previous calls will await the new, overriding call.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Sep 27, 2022
@danielroe danielroe requested a review from pi0 September 27, 2022 13:29
@danielroe danielroe self-assigned this Sep 27, 2022
@codesandbox
Copy link

codesandbox bot commented Sep 27, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Sep 27, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 368b55a
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6332ffb590bff60008f05ed0

@danielroe danielroe mentioned this pull request Oct 9, 2022
@danielroe danielroe requested a review from Atinux October 10, 2022 10:14
@danielroe danielroe merged commit 3856744 into main Oct 10, 2022
@danielroe danielroe deleted the feat/override-refresh branch October 10, 2022 10:33
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force refresh for useAsyncData and useFetch useAsyncData refresh can not be called until promise is resolved
2 participants