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

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

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

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

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#14746, resolvesnuxt/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.

@danielroedanielroe 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 pi0September 27, 2022 13:29
@danielroedanielroe self-assigned this Sep 27, 2022
@codesandbox

Copy link
Copy Markdown

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

@netlify

netlifyBot commented Sep 27, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit368b55a
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/6332ffb590bff60008f05ed0

@danielroedanielroe mentioned this pull request Oct 9, 2022
@danielroe
danielroe requested a review from atinuxOctober 10, 2022 10:14
@danielroe
danielroe merged commit 3856744 into mainOct 10, 2022
@danielroe
danielroe deleted the feat/override-refresh branch October 10, 2022 10:33
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or request🍰 p2-nice-to-havePriority 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

@danielroe@atinux