When you use modules the local state will be available to mutations, getters and actions in different ways.
const moduleOne = { state: { count: 0 }, mutations: { increment (state) { state.count++; // Here state refers local module state } }, getters: { average (state) { return state.count / 2 } } }
const moduleOne = { actions: { incrementConditional ({ state, commit, rootState }) { if (state.count < rootState.count) { commit('increment') } } } }