ThoorAdam
multiple awaited useFetch
Hello!
Is it a good idea to have multiple
useFetch
-calls being awaited on a page after eachother? Or should I wrap them in something like Promise.all()
? Does that approach have drawbacks?
I feel like having them after one another might slow down loading of pages since they are sequential?5 replies
useFetch type inference
Hello!
Been using nuxt for a few days now and most things are amazing so far, love the overall DX. I do have one small gripe with useFetch though.
Take the following code
This seems to infer the types, at least somewhat, but it leads to strange linting errors not letting me access the values of the recipe.
However if I do the following and use a generic it does work as i expect it to.
Do I really need to use generics everytime I fetch data to get the correct type inference? Don't get me wrong, it's not the biggest hassle, until I change what data the route returns for example. Then it could mean changing the generic in a lot of places.
7 replies