DEV Community

Discussion on: You Might Not Need Vuex with Vue 3

 
philippm profile image
Philipp Mildenberger

I have yet to see what real benefits Vuex or in general a Flux-based solution is providing compared to such simple solutions. In my eyes it's more flexible and less boilerplate heavy. If you need more features one can always write up logic around that specifically for the usecase (e.g. what we currently have a model manager that takes care of model instantiation, persistence etc.).
The only really thing that I currently see where vuex has advantages is vue dev tools integration.

Do you have examples where vuex shines compared to that solution?

Thread Thread
 
vitandrguid profile image
Vitor Andrade Guidorizzi

I agree with this, I'm writing a really large vue2 + vuex + ts SPA and thought that vuex would be obligatory, turns out making a really strict typed store with vuex 3 and a lot of store modules is possible but infuriating, its 10 times the boilerplate and whenever you use your store on a component vuex doesn't infer the typing due to its weird string accessor of getters, state and what not.

After fighting against the lib lack of proper TS support i decided to test some libs like vuex-class-modules, vuex-module-decorators and many others, every single one had annoying issues or lacked features.

Looking back, the only thing vuex has that is awesome is the community plugins and the devtools debugger, but i don't think its worth it, with the new composition API i don't see much reason to use it, especially since you can enforce your own accessors and practices instead of the weird soup that is vuex