From 3e25e7ee5f8b67addc3e2a482961269af2fc99c1 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 8 Oct 2020 15:32:54 +0300 Subject: [PATCH] persistState: Fix typo --- src/store/plugins/persistState.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/store/plugins/persistState.js b/src/store/plugins/persistState.js index a997bc1fd..c63718be8 100644 --- a/src/store/plugins/persistState.js +++ b/src/store/plugins/persistState.js @@ -33,11 +33,11 @@ export const resetState = () => { export default (reducerLoad, reducerSave) => (store) => { let resetting = false; - let lastEmitedState = reducerLoad(getState(), store); - store.commit('syncState', lastEmitedState); + let lastEmittedState = reducerLoad(getState(), store); + store.commit('syncState', lastEmittedState); store.subscribe(({ type, payload }, state) => { - if (resetting || (type === 'syncState' && payload === lastEmitedState)) return; + if (resetting || (type === 'syncState' && payload === lastEmittedState)) return; setState(reducerSave(state)); }); @@ -51,7 +51,7 @@ export default (reducerLoad, reducerSave) => (store) => { }); window.addEventListener('storage', () => { - lastEmitedState = reducerLoad(getState()); - store.commit('syncState', lastEmitedState); + lastEmittedState = reducerLoad(getState()); + store.commit('syncState', lastEmittedState); }); };