Vuex is an essential tool in the Vue.js ecosystem. New developers may be repelled by jargon terms like "state management pattern" and confused as to what they actually need it for. Here's the primer on Vuex that I wish I'd had when I started learning.

Post cover image
Table of contents
VuexThe problem that Vuex solvesFluxPrinciple #1: single source of truthPrinciple #2: data is read-onlyPrinciple #3: mutations are synchronousCool, so what exactly is Vuex?Setting up a Vuex to-do appInstalling VuexCreating a Vuex storeAdding the store to a Vue instanceCreating a simple appDefining store stateDefining mutationsUsing mutations i.e. "commits"Reading store dataDefining getters

Sort: