const getDefaultState = () => { return { reviewersQuery: null, isEnglish: true } } const state = getDefaultState const mutations = { RESET_STATE: (state) => { Object.assign(state, getDefaultState()) }, SET_QUERYPARAM: (state, query) => { state.reviewersQuery = query }, SET_ISENGLISH: (state, isEnglish) => { state.isEnglish = isEnglish } } const actions = { resetState({ commit }) { commit('RESET_STATE') } } export default { namespaced: true, state, mutations, actions }