You can use clearInterval
In your store you add a property to store the interval.
let store = {interval: null},
Store the interval when calling it.
TIMER(){
store.x = setInterval(() => { context.commit('reduceTimer';) }, 1000;)
}
Then you create another action to clear it
actionName() {
clearInterval(store.interval);
}
Then call the action that clear it on every route change.
new Vue({
// ...
watch: {
'$route': function(to, from) {
store.dispatch('actionName');
}
}
})
PS: I didn't use mutations just for simplicity.