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 ;)
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!
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
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
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?
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: th-cam.com/video/njsGVmcWviY/w-d-xo.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.
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.
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.
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
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) }, })
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).
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 ☺️)
Yess!!!!!
Haha, waited for this one for a while? 😁
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! 🙌
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!
This is very helpful! Thank you always.
You're so welcome! 🙌
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 👌
Thanks a lot for this important insight!
Glad it was helpful! 🙌
Like your videos more and more, great job as always!
Thank you very much! Is there anything on your mind that could be better? 😊
so, is useAsyncData like react's useMemo with a different life cycle?
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 🙌
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 🤔
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 ☺️
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!
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: th-cam.com/video/njsGVmcWviY/w-d-xo.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.
That thumbnail is so fun 😂
A hilarious one every now and then 😛
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
I love you man, always helpful and super insightful
You are welcome! Glad I can help 🙏🏻
as always: thank you :)
My pleasure! 😊
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.
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? 🤔
nice video alex!
Glad you enjoyed it 😋
'DX' is short form for what?
Developer Experience ☺️
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! th-cam.com/video/njsGVmcWviY/w-d-xo.html 🙌
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 ☺️
useAsyncData is more like useEffect in react that has watcher
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 th-cam.com/video/jXH8Tr-exhI/w-d-xo.html 😊
Thank You
You're welcome 👌
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).
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
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 th-cam.com/video/Tu9R074zPz0/w-d-xo.html too 🙌