In my Vuex code, I currently have the following:
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)
})
},
},
})
While I assign the value of setInterval to state.intervalVar, I am unsure of how to properly clear this interval using state.intervalVar.