I want to add a new key/value pair to a Map which is nested in another Map. If the key already exists it should get replaced.
I thought mergeDeepIn() should to the trick but I get an "invalid keyPath" Error.
The state looks like this:
{
"requests":{
"1":{
"title":"I have a question",
"customerId":2,
"messages":{
"222":{
"text":"Hello!",
"senderId":1,
},
},
...
},
...
},
}
'requests' and 'messages' are immutable Maps.
I tried this:
const message = fromJS({
"5": {
text: "test",
},
})
state.mergeDeepIn(['requests', 1, 'messages'], message)
The message should get added to the 'messages' Map.