useFetch vs $fetch
Hello,
First of all, I understand that :
- useFetch = useAsyncData + $fetch
- $fetch is pre-hydration (if awaited, even resolved pre-hydration)
That being said, with SSR fully disabled, is there any perk using useFetch instead of $fetch ?
SSR is disabled for me because :
- Nothing will be publicly accessible anyway, no SEO needed
- For the type of project, it's more important to reduce the server workload and the client will be ok to "wait the extra time"
Thanks π
2 Replies
Alexander Lichter
YouTube
You are using useFetch WRONG! (I hope you don't)
πͺπ» useFetch is a mighty composable to fetch data in your Nuxt.js application. It can do so many things, from updating state to refreshing calls easily and even data caching is possible. But often I see that people misuse useFetch because it is so tempting to use all the features, even when you shouldn't. In this video I show the most common mist...
Sorry I meant to GET data when loading a page π