Is there any elegant way of removing an object from an array which is part of an array? I have been working with React and Redux for a while now but get stuck several hours everytime I have to remove or insert data without mutating the state.
The reducer is an array containing objects which have an ID and another array with objects, like this:
[
{ id:123,
items:[
{ id: abc,
name: albert
},
...
]
},
...
]
I receive both IDs and need to remove the item with ID abc
.