Is vuex necessary or does minimongo serve the same purpose?


#1

Is there any use benefit using vuex in meteor?

I understand that a centralized data/state store is great to have, but it seems minimongo and collection helpers are already serving this purpose.

How would I use them together with vuex… Or should I just forget about vuex when working with meteor?


#2

Minimongo is strictly for storing mongo documents that you subscribed to. Vuex is more general purpose and can be used for state variables, such as form inputs. I utilize both Minimongo and Redux (similar to Vuex) on my app and it works well.


#3

Do you use redux for general state (e.g. items in shopping cart, component visibilities,…) or also to store model instances and helper functions (actions)


#4

Anything that you would normally use a component’s state for. So shopping cart items, visibilities, yes.

Helper functions (such as formatting data for presentation) are not a part of Redux, but functions that you would normally use to modify a component’s state (handling form input, incrementing a counter) are. They are called actions.

Not sure what you mean by ‘model instances’.


#5

Personally I haven’t found a use for Vuex yet. My app only has about 5 “global state variables”, which I store on the root instance (conveniently accessible from any component with this.$root). The rest is local component state, and collection data. If your app needs a lot of global state though, Vuex would be useful