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
I have this structure of Settings model const state = { price_between: { enabled: false, value: [0,0] } }
Then change the value to [10, 10] via mutation; state['price_between'].value = [10, 10]; and it works fine, and i get this array as expected.
But now i refresh page and get state: state.price_between === [0, 0, 10, 10];
And every time i reload page, it just adding new values in array; I never use .push() or something. Always changing like value[0] = 10;
The text was updated successfully, but these errors were encountered:
I think i found problem. Becouse on load module use deep-megre, arrays comparing by values, and add not existed before values.
I changed my structure to const state = { price_between: { enabled: false, from: 0, to: 0 } }
I have this structure of Settings model
const state = { price_between: { enabled: false, value: [0,0] } }
Then change the value to
[10, 10]
via mutation;state['price_between'].value = [10, 10];
and it works fine, and i get this array as expected.But now i refresh page and get state:
state.price_between === [0, 0, 10, 10];
And every time i reload page, it just adding new values in array; I never use
.push()
or something. Always changing likevalue[0] = 10;
The text was updated successfully, but these errors were encountered: