This code appears in a vuex
project:
store.watch(
(state) => state.sessions,
(val) => {
console.log('CHANGE: ', val);
localStorage.setItem('vue-chat-session', JSON.stringify(val));
localStorage.setItem('islogin', JSON.stringify(val));
}, {
deep: true
}
);
What does the code mean? Does Vuex also have watches?
ringa_lee