I have the following code in my vuex:
export default new Vuex.Store({
state: {
intervalVar: 0
},
mutations: {
SET(state, {key, value}) {
state[key] = value
},
},
actions: {
doSomething({commit}) {
commit("SET", {
key: 'intervalVar',
value: setInterval( () => console.log('hi'), 30000)
})
},
},
})
as you see I give setInterval value to state.intervalVar but I have no idea how I can do cleareInterval on state.intervalVar.