You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR #64 introduced a bug. The full state is observed and is deeply cloned before the filtering of the statesPaths the next line.
This lead to a full state copy instead of only the portions we need to sync.
You should only clone the wanted portion of the state :
if(statesPaths.length===0)return{ ...newState};statesPaths.forEach((statePath)=>{constnewValue=cloneObj(pick(statePath,newState));// clone only the wanted path
...
This deep cloning algorithm is also causing issues for objects with Dates. That said, I'm not entirely sure whether it is a good practice/officially (not) recommended to store Dates in Vuex in the first place, but that caused crashes in production because Dates had been destroyed after the cloning.
Though I'm very grateful for that library, it was a real savior for me.
Hi,
The PR #64 introduced a bug. The full state is observed and is deeply cloned before the filtering of the statesPaths the next line.
This lead to a full state copy instead of only the portions we need to sync.
You should only clone the wanted portion of the state :
The faulty line is here : https://github.com/abernh/vuex-multi-tab-state/blob/3d0bc186db0741309f1e1a42fb26dad964f5f5b5/src/index.ts#L48
The text was updated successfully, but these errors were encountered: