Vuex is a centralized state management pattern and library for Vue applications (similar to redux, only instead it mutates the state directly instead of returning a brand new one; reducers vs. mutations). This centralized state is the single source of truth for the application and provides data that is accessible by any view in the application (better alternative than passing down data to child components).
- State Tree: An object containing data
- Getters: Functions that return data from the
State Tree - Mutations: Functions that perform modifications on the data in the
State Tree - Actions: Functions that commit
Mutations. Main difference fromMutationsis thatActionscan contain asynchronous operations which in turn performMutations