Reputation: 3156
I have a structure like this one:
{
members: [
{ memberId: 1, workspaces: [123, 124] },
{ memberId: 2, workspaces: [124] },
...
]
}
How could I update the workspace list for one member with Immutable.js?
Upvotes: 0
Views: 889
Reputation: 3156
Found!
members.updateIn(
['0', 'workspaces'],
(workspaces) => workspaces.push(125)
)
Upvotes: 2