DEV Community

Discussion on: What was your win this week?

Collapse
 
juniordevforlife profile image
Jason F

What are your thoughts on Vuex?

Collapse
 
louiseann93 profile image
Lou Willoughby

I thought it was ok. It’s really helpful when using it for our cart system as I can make each component responsible for just getting and mutating the data it needs rather than passing through props but because they load on render and there was milliseconds of a delay for the actions to set the data correctly it can be an issue especially if you have multiple as they’re asynchronous. I had to use a lot of v-ifs and timeouts in places which was just a bit of a pain to figure out and fix

Thread Thread
 
juniordevforlife profile image
Jason F

Ahhh dang. Sounds like maybe a use case for RxJS.

Thread Thread
 
aarone4 profile image
Aaron Reese

Vuex is the Vue (2) implementation of the redux pattern with actions and mutations. The browser tooling is really good with the ability to time travel though the changes in state.
However Vuex 4 does not play so nicely with Vue 3 and it looks like Pinia is now the official redux Library for Vue 3 as it supports typescript and Vuex 5 is no more.