Welcome back! This is the second part in n (still not decided) part series trying to help developers with knowledge of either Redux
or Vuex
understand the other one. If you want to read about reducers, mutations, actions and async action, you can read them here in part- Ⅰ.
OK, so with the customary disclaimer for multi-part series out of the way, let’s dig into our main topic.
To create a new store, you need to import createStore from redux
.
Similarly, for Vuex
store can be created using Store constructor.
Now that we’ve created our store
, we need to make sure that our components can use it. We can either pass the store object to each component (too tedious 😩) or we can pass the store to the root element such that it becomes available to all the components. …
I recently created a basic todo app (learning) using Vue.js, and Apollo GraphQL. When my senior (having working experience in React) started reviewing the client-side code a lot of his questions were related to Vuex, a state management pattern & library for Vue. As he had experience with Redux, terminology of Vuex was a little confusing for him. That’s where the idea of writing an article which helps developers, who have experience with one migrate to other library came to existence (yes existence!! …