const store = {
state: {
lockingPool: 0
},
getters: {
isUiLocked: state => state.lockingPool > 0
},
mutations: {
lockUi: state => state.lockingPool++,
unlockUi: state => state.lockingPool--
},
actions: {
async someAction ({ commit }) {
commit('lockUi')
const { data } = await http.get('/some-url')
commit('unlockUi')
}
}
}