Thank you again, I really like your videos and examples, even though I watched all it will be helpful to include the link or the video when you mention it :) Thanks again for keeping it going 🙏
Your content is great and the way you explain things is awesome ! here is a small advice: thhe noise cancelling is cutting some words some time. You may need to reduce it ;)
your videos are great help to understand behind seen, nowadays i see most nuxt video cover composables and predefined function majorly , i would like you to explore layouts as it seem less explored part of nuxt like implementing persistence layout, nested layout and hook functions in nuxt, may be your tricks help in IRL work
Thank you. Could you kindly elaborate on why the useFetch function isn't universally applicable? It feels like a design flaw ... akin to React's approach, requiring users to be aware of specific exceptions, e.g. when dealing with all of their hooks.
What exactly do you mean with "isn't universally applicable"? That you can only use it in a Vue context? 👀 (Related: ruclips.net/video/njsGVmcWviY/видео.html )
@@TheAlexLichter Thank you for getting back. As highlighted in both the documentation and the video, it's emphasized that useFetch is intended for data fetching in a component setup function, while $fetch is better suited for making network requests triggered by user interaction.
Thank you for your video! Could you please give me an advice. I wanna make the app which can be managed in both directions: if i change my reactives, data will changes and if i come from another page with pre-set query, the data should be correct. Struggling with that 😵 P.s. Using useAsyncData
As always, great content! Also, I have a question; Is it okay to use Nuxt with complete Client side rendering (Full SPA)? In my work, they can't afford ssr, should I go with nuxt to get all the benefits or it would be overhead?
It would be nice to have composable for mutation like `useMutation` available in tanstack query currently for mutation we can't use useFetch and it does not success, error callbacks.
Thanks for the video. I am still little confused between the ways to do fetching. I am still learning a lot. Mabe a video for beginners? Why not always use useasyncfetch?
@TheAlexLichter hi. Yes for example I use the nuxt supabase module. And fetch some data. What is best practice for example? The example in the document uses useasync data. I also red that usefetch caches the data? Or when I fetch data from a own server api I just use /fetch. That also works fine? Lot of questions haha
Haha, just because I am not there I can't let the people wait for the content 😁 Though I didn't do many announcements around (will do that on Monday) Was nice meeting you in person!
Hi great tutorial. I am using useAsyncData with a handler function that performs multiple $fetch's within to populate page data (as I am hitting a few different apis). But when in my /server/api route I am seeing it is getting called twice. Any ideas on a solution?
@@TheAlexLichter I think I got the issue sorted on dev mode. But I notice on prod it's hitting the API twice, almost like it's rendering the page twice or hitting it client and server side at the same time.
am trying to use fetch with a laravelapi and when i run my nuxt app i get that useFetch component has already been mounted see the $fetch what can i do about this
For other that may wonder, I asked copilot “Why the name $fetch?” Instead of ofetch: - The name $fetch is chosen for consistency and ease of use. - It aligns with Vue’s convention of prefixing instance properties with a dollar sign (e.g., $data, $props, $emit).
Great video as always. How would you leverage useFetch with a repository pattern? My whole repository file is sustained on something like this and the same query might at some point be triggered by user interaction (which triggers a warning when using useFetch) or just plain data fetching (which works just fine): import type {$Fetch, NitroFetchRequest} from 'nitropack' import type {ApiResponse, ApiResponseWithCursorMeta} from "~/types/responses.generics.interface"; export const eventsRepository = (fetch: $Fetch) => ({ async get(cursor: null | string = null): Promise { let url = '/events/'; if (cursor) { url += `?cursor=${cursor}` } return fetch(url) }, })
Thank you again, I really like your videos and examples, even though I watched all it will be helpful to include the link or the video when you mention it :)
Thanks again for keeping it going 🙏
Thanks for the suggestion! I include all links in the descriptions and videos as cards in the corner of the video (+ in the description ☺️)
Your content is great and the way you explain things is awesome ! here is a small advice: thhe noise cancelling is cutting some words some time. You may need to reduce it ;)
Thanks for the tip! Will revisit my gate settings 👌
Perfect explanation once again! 👌
Thank you! 🙌
It would also be nice to see how to build useAsyncData from scratch and how it works under the hood.
Great idea! Added to the list 👌
Amazing video as alsways! Perfect topic as always :D
Glad you think so! 👌
Let me know if you have any ideas or topics in mind!
Yess!!!!!
Haha, waited for this one for a while? 😁
your videos are great help to understand behind seen, nowadays i see most nuxt video cover composables and predefined function majorly , i would like you to explore layouts as it seem less explored part of nuxt like implementing persistence layout, nested layout and hook functions in nuxt, may be your tricks help in IRL work
Glad they help 🙏🏻
I put nested layouts on the list 👍🏻
Hooks are also interesting but they need specific use cases ☺️
This is very helpful! Thank you always.
You're so welcome! 🙌
Could you please provide a link to source code of app shown in the video? I wanna save it for future reference
I love you man, always helpful and super insightful
You are welcome! Glad I can help 🙏🏻
Like your videos more and more, great job as always!
Thank you very much! Is there anything on your mind that could be better? 😊
Thank you. Could you kindly elaborate on why the useFetch function isn't universally applicable? It feels like a design flaw ... akin to React's approach, requiring users to be aware of specific exceptions, e.g. when dealing with all of their hooks.
What exactly do you mean with "isn't universally applicable"? That you can only use it in a Vue context? 👀
(Related: ruclips.net/video/njsGVmcWviY/видео.html )
@@TheAlexLichter Thank you for getting back. As highlighted in both the documentation and the video, it's emphasized that useFetch is intended for data fetching in a component setup function, while $fetch is better suited for making network requests triggered by user interaction.
How can the above methods be leveraged, for example, in the case of an AWS Amplify GraphQL call?
Same idea, but using POST. I'd probably use a dedicated GQL lib/module though
so, is useAsyncData like react's useMemo with a different life cycle?
Thanks a lot for this important insight!
Glad it was helpful! 🙌
Thank you for your video!
Could you please give me an advice. I wanna make the app which can be managed in both directions: if i change my reactives, data will changes and if i come from another page with pre-set query, the data should be correct. Struggling with that 😵
P.s. Using useAsyncData
You are welcome!
Both ways should work by "watching" the route query I'd say 🤔
As always, great content! Also, I have a question; Is it okay to use Nuxt with complete Client side rendering (Full SPA)? In my work, they can't afford ssr, should I go with nuxt to get all the benefits or it would be overhead?
Yes, absolutely! You can build a plain old SPA with Nuxt if you don't need SSR!
It would be nice to have composable for mutation like `useMutation` available in tanstack query currently for mutation we can't use useFetch and it does not success, error callbacks.
You could use useFetch with interceptors though, couldn't you? 🤔
Thanks for the video. I am still little confused between the ways to do fetching. I am still learning a lot. Mabe a video for beginners? Why not always use useasyncfetch?
Which one do you mean
Why not always use useFetch?
Or
Why not always use useAsyncData?
👀
@TheAlexLichter hi. Yes for example I use the nuxt supabase module. And fetch some data. What is best practice for example? The example in the document uses useasync data. I also red that usefetch caches the data? Or when I fetch data from a own server api I just use /fetch. That also works fine? Lot of questions haha
@@TheAlexLichter Hello. Could you please provide a link to source code of app shown in the video? I wanna save it for future reference
Nice video, as always! How do you do that, talking at conferences and posting video's on yt at the same time lol 😅
Haha, just because I am not there I can't let the people wait for the content 😁
Though I didn't do many announcements around (will do that on Monday)
Was nice meeting you in person!
awesome as usual! Thank you !
Thank you! Glad it helps 🙌
Hi great tutorial. I am using useAsyncData with a handler function that performs multiple $fetch's within to populate page data (as I am hitting a few different apis). But when in my /server/api route I am seeing it is getting called twice. Any ideas on a solution?
Do you possibly have 2 components calling the same API?
@@TheAlexLichter I think I got the issue sorted on dev mode. But I notice on prod it's hitting the API twice, almost like it's rendering the page twice or hitting it client and server side at the same time.
am trying to use fetch with a laravelapi and when i run my nuxt app i get that useFetch component has already been mounted see the $fetch what can i do about this
My video about useFetch should help you there! ruclips.net/video/njsGVmcWviY/видео.html 🙌
For other that may wonder, I asked copilot “Why the name $fetch?” Instead of ofetch:
- The name $fetch is chosen for consistency and ease of use.
- It aligns with Vue’s convention of prefixing instance properties with a dollar sign (e.g., $data, $props, $emit).
useAsyncData is more like useEffect in react that has watcher
That thumbnail is so fun 😂
A hilarious one every now and then 😛
if the url is build upon query, which is not the options of useFetch, how to make it work
How do you mean that? You can pass it to useFetch anyway ☺️
'DX' is short form for what?
Developer Experience ☺️
nice video alex!
Glad you enjoyed it 😋
Great video as always.
How would you leverage useFetch with a repository pattern? My whole repository file is sustained on something like this and the same query might at some point be triggered by user interaction (which triggers a warning when using useFetch) or just plain data fetching (which works just fine):
import type {$Fetch, NitroFetchRequest} from 'nitropack'
import type {ApiResponse, ApiResponseWithCursorMeta} from "~/types/responses.generics.interface";
export const eventsRepository = (fetch: $Fetch) => ({
async get(cursor: null | string = null): Promise {
let url = '/events/';
if (cursor) { url += `?cursor=${cursor}` }
return fetch(url)
},
})
Thank you!
I'd go with useAsyncData as shown in ruclips.net/video/jXH8Tr-exhI/видео.html 😊
as always: thank you :)
My pleasure! 😊
so headache, i would use axios instead :)).
Keep in mind that axios is comparable to $fetch but not to the fetching composables like useFetch or useAsyncData
Thank You
You're welcome 👌
ow God I love you
🙏🏻🙏🏻🙏🏻
Because it is checked (up to) 3x in the code 😊
Does that cause an issue?
I briefly talked about that in ruclips.net/video/Tu9R074zPz0/видео.html too 🙌