I have an array of elements which was updated inside an action, now I want to update it in the store. Currently I have something like:
navigation
|_navigationItems:[{1:"foo"}, {2:"bar"}, {3:"foobar"}]
The thing is I was doing the following:
case types.UPDATE_NAVIGATION:
return Object.assign({}, state, {
navigationItems: action.payload.items,
});
where items is: [{1:"zoo"}, {2:"foobar"}]
but store was not updated succesfully.
Did I miss something?
console.log()just after thecaseis called and there I have the array updated.case types.UPDATE_NAVIGATION: return {...state, navigationItems: action.payload.items}Object.assign?