[Vuejs]-Vuex (Flux) pattern: Which type of data should be stored in it?

0👍

One of the main purposes of Vuex is to be single source of truth for the application. It means that it should definitely hold information that is used in multiple places.

Additionally, Vuex holds not only application state, but all the relevant data – you can have separate modules for UI and User, and Cars.
As a rule of thumb: if you use data in multiple places – store it in Vuex. If data used in one place – you can do without the state in Vuex and live with component-state.

More info: https://markus.oberlehner.net/blog/should-i-store-this-data-in-vuex/

Leave a comment