Reputation: 4072
I'm using "immutable": "^3.8.1",
in my redux store (ngrx). I know that it's installed because I have successfully converted my stated into an immutable object
const immState = Imm.fromJS(state);
But I hit an issue when I tried to delete a deeply nested item with this command:
return immState.deleteIn(['days', dayKey, 'userMeals', state.focus_user], meal._id);
Immutable.js is throwing an error when it hits 'userMeals'
and upon further investigation, it seems that Imm.fromJS()
is not converting a deeply nest object into an immutable structure. In the image below I try to access that property directly, but it is still not converting it into an immutable object.
Is this somehow the expected behavior or am I missing something?
Upvotes: 1
Views: 591