I think that it's a good approach with Pinia.
Fetching data into the state of a Pinia store
Hi, I have a question regarding fetching data into the state of a Pinia store from an API
in my application I have 3 routes: Dashboard, Programs, Modules
Dashboard shows stats about programs and modules Programs and Modules show list of records
I call getPrograms and getModules from their corresponding components
and I also need to call them from the dashboard component
now each time I visit a route the request will be sent to get the data, here I can add a guard to the actions to only fire when the state is not already seeded with data but I'm not sure if there is a better way to do it?
Thank you!
Please or to participate in this conversation.