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

fix(nuxt3): improve error types for useAsyncData and useFetch - #4210

Merged
pi0 merged 17 commits into
nuxt:mainfrom
Mini-ghost:feat/fetch-error-type
Apr 29, 2022
Merged

fix(nuxt3): improve error types for useAsyncData and useFetch#4210
pi0 merged 17 commits into
nuxt:mainfrom
Mini-ghost:feat/fetch-error-type

Conversation

@Mini-ghost

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ 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

Let useFetch() and useLazyFetch() return error can defined type by generics, like below:

const{ data, error }=useFetch<TData,TError>('url')

📝 Checklist

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

@netlify

netlifyBot commented Apr 8, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit20d9556
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/626c30bd4ff998000828e02e
😎 Deploy Previewhttps://deploy-preview-4210--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pi0
pi0 requested a review from danielroeApril 8, 2022 20:18
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
@Mini-ghost

Copy link
Copy Markdown
MemberAuthor

@danielroe I adjusted the generics naming, but I'm not sure why the test the CI / test-fixtures (windows-latest, 16) is wrong

Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
@Mini-ghost
Mini-ghost requested a review from pi0April 12, 2022 08:57
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
Comment threadpackages/nuxt3/src/app/composables/fetch.ts Outdated
@pi0

pi0 commented Apr 22, 2022

Copy link
Copy Markdown
Member

@danielroe Can you please check this PR for refactors?

@danielroedanielroe self-assigned this Apr 25, 2022
@pi0pi0 changed the title feat(nuxt3): let useFetch() return error can defined type by genericsfix(nuxt3): improve error types for useAsyncData and useFetchApr 29, 2022
pi0
pi0 approved these changes Apr 29, 2022
@pi0

pi0 commented Apr 29, 2022

Copy link
Copy Markdown
Member

Thanks @Mini-ghost@danielroe 💚

@pi0
pi0 merged commit eb903bd into nuxt:mainApr 29, 2022
@pi0pi0 mentioned this pull request May 2, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Mini-ghost@pi0@danielroe