I have a page with several components on it, one of the components reads redux state.
When there some changes occur on the redux object component it reloads, shows the spinner and all the data on the component gets updated.
But my task is to update one single value in the redux object state without having to rerender and refresh everything.
For instance here is the redux object, which holds an array of objects with some data.
I need to update one value state in a certain object let say the last one.
But I need to do it without having to update all-state.
state:{
0:{
name : 'some name.....',
surname: 'some surname',
age: '23',
phone: '+12345678'
state: 'ON'
},
1:{
name : 'some name.....',
surname: 'some surname',
age: '23',
phone: '+12345678'
state: 'ON'
},
2:{
name : 'some name.....',
surname: 'some surname',
age: '23',
phone: '+12345678'
state: 'OFF' <-- I need to update only this one
},
}
I have one function in Redux actions that load all these data.
But now I need something like a separate function updateData function which will be updating one value in an existing state object without having to refresh everything.
Is it possible to do so in Redux?