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

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

Merged
danielroe merged 5 commits intomainfrom
feat/override-refresh
Oct 10, 2022
Merged

feat(nuxt): refresh override for data fetching composables#7864
danielroe merged 5 commits intomainfrom
feat/override-refresh

Conversation

@danielroe
Copy link
Copy Markdown
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
Copy Markdown

codesandbox Bot commented Sep 27, 2022

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

@netlify
Copy link
Copy Markdown

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