me
Vuex vs React Redux
May 27, 2017
1 minute read

Vuex introduced me to another way of implementing Flux.

Flux is an “APPLICATION ARCHITECTURE FOR BUILDING USER INTERFACES”. If you ever build a single page app with multiple routes and nested components, managing state is a nightmare. Flux makes it easier to manage and it makes sense. I’ve used it in multiple react apps with Redux, Peer Review being my last one, and it’s helpful. It takes a lot of work to set up and multiple files, but it makes sense in large applications.

I found the way Vue.js implements Flux to make more sense. I recently gave a talk at the Vue meetup about setting up Vuex from scratch (video below). This talk highlights the difference in jargon and flow of communication.

The biggest difference is that Vuex out of the box handles asynchronous events and the way to change state is with Mutations, which, as the name suggests, mutates the state instead of having the state immutable and replacing it with Reducers. Personally this is easier to reason about and is what you want to do anyways.

Code and Slides


Back to posts


comments powered by Disqus