0
I’m using a state of reducer
, containing an object in this format:
x = {10: {nome: 'lucas'}, 20:{nome: 'beraldo'}} <br/>
And, I get an id via action.
I’d like to do something like array.filter
, or the delete
only dynamically on this object, to remove an item, for example:
delete x.actionID
Only he can’t understand the action.ID
, since it’s coming from the action.
If it were an array, it would x = x.filter(nome != action.id)
, but since it’s an object, I don’t know how to treat.
Have you tried
delete x[actionID];
?– Sam