This is a bit of a Vue/Vuex efficiency / confirming best practice question.
I have an API returning a paginated data-set of 50 products, of which I am saving in a Vuex store.
For my "show all products" view I'm iterating over the Vuex store.
For my individual product route I'm in two minds whether to load the product directly from the Vuex store (meaning there isn't any need to request the product again, hence faster.) OR to just request that product from my API.
I guess the trade off is the initial request to the API would need to respond with more data than what the user would initially be exposed to in the "show all products" view, and hence it seems a bit wasteful.
Any thoughts and opinions on this? Just want to confirm my thoughts really with another person.
Also with Vuex, is it feasible to keep appending data to the store? for example if the user was cycling through more products, should I be appending the additional data back from the API into the store, or just keeping a rolling 50 records for example?
Thanks a lot!
Phil