Hello mr vincent15000 for my projects i'm using store for each model ex) productstore.js , contactStore.js, homestore.js
Use a store (pinia) for all data or just for the shared data ?
Hello,
In a personal project, I have tried to manage all datas via the store (with pinia, but it could have been another store manager).
What's the better solution ?
-
manage all datas via the store ?
-
manager only the shared datas via the store ?
Is it for example a good idea to load in the store all the contents of the select / options fields so that I don't have to load them each time I open a form ?
What I noticed myself via this experience is that it's perhaps not useful to use a store to manage a form, but it's useful to open / close a modal form from different components. Furthermore it's probably interesting to use a store when I have to manage events between components, for example if I change the category of an object, using the store to fire this update can be useful to recalculate statistics automatically.
According to me, it seems heavy to manage all datas inside the store as it's similar to transfer all the business logic to the store and it's not its purpose.
Thanks for your opinion.
V
Please or to participate in this conversation.