I need to update the state in my React component:
The state looks like this:
const state = {
'123': [{
progress: 0;
lastModified: 999;
},
{
progress: 0;
lastModified: 666;
}],
'1234': [{
progress: 0;
lastModified: 111;
},
{
progress: 0;
lastModified: 222;
}]
};
Given that I know the object key e.g. 123
I want to update the progress
value given that i also know the lastModified
to use to find the object.
How to go about this in an immutable way?