Array default values #103
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MichaelContento/redux-storage#103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi! I have a test reducer:
myReducer = (state = { arr: [1, 2, 3] }, action) => action.type == 'TEST' ? { arr: [5] } : stateIt's save to store correctly after dispatch:
{ arr: 5 }But after load it's has a value
{ arr: [5, 2, 3] }.Lo-dash
_.mergeproblem.Hi! Could you provide me some example code?
I've tried to reproduce this problem but with no success. For me everything looks and behaves as is should ...
Maybe I use it wrong, but
arr = [1, 2, 3]arr = [1, 2, 3]arr = [5]arr = [1, 2, 3]arr = [5, 2, 3]Hm .. strange. Would it be possible for you to inspect the state of the engine right BEFORE you trigger the load action? This depends on the engine in use but for redux-storage-engine-localstorage the output of:
would be very interesting!
Ok. It's my store.js now.
0. I open page and run
clearStorage()store.dispatch({type: 'TEST'})Could you also please paste the result of
npm listso that I can see the used versions of all involved libraries? I still have no clue whats the root cause of this :(And a last question: in which browsers have you tested this?
I use Meteor 1.2.1, it's
meteor listout and packages.json file used by meteorhacks:npm.Browser: Chrome 48.
I don't spend a lot of time, but quickly looked at your code. Are you use lodash
mergefunction after action Load? If so, it may be the cause because_.isEqual(_.merge([1,2,3], [5]), [5,2,3]) // trueredux-storage-merger-simple is the default merger used by redux-storage. Please have a look at it and create a issue there with some code to reproduce this issue.
I'm closing this issue here now, as a) it's no longer related to the code in this repository and b) I'm still unable to reproduce this :(