Answer the question
In order to leave comments, you need to log in
How to update a complex state?
case ACTIONS.GENERIC_SUCCESS:
let datas = data.result.map(v => v.count);
let lines = state[kind][id].data = datas;
return Object.assign({}, state, {...lines});
{lines: [kind]: [id]: data}
Answer the question
In order to leave comments, you need to log in
via $merge Immutability Helper try
https://facebook.github.io/react/docs/update.html
https://github.com/kolodny/immutability-helper
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question