Vue, Pinia, VueRouter and await
When data fetching, what is the best way to fetch and then store in Pinia?
use
await
inside your store??
Or have variables in your store and fetch from a composible
in a index.vue
I would prefer to use just one .vue file if possible, but it seems at the moment, I have to use multiple
like /tags/my_tag
which are done by just making a tags
folder and puting [my_tag].vue
in there
My reason for usia a pinia store is to sync data across .vue files
I'm trying different combinations but keep breaking my app!3 Replies
Assuming you have a centralized fetch client i.e.
Then you just create a store and await there yeah
There's nothing preventing you from importing the store across different files
I've copied your code
just wondering why you don't use the Composition API
just thinking, a strategy to make sure getFiles is only run once
Oh yeah sure, no reason not to
Was just simplified for the example