I've a following hierarchy of immutable list:
fromJS({
departments: [{
departmentName: 'PHP',
employees: [{
employeeId: 1000,
employeeName: 'Manish',
projects: [{
projectId: 200,
projectName: 'ABC'
},
{
projectId: 300,
projectName: 'DEF'
}]
}]
}]
})
In this list, I want to update the project name of project ID 200. Though I can update the simple one level of array of objects by finding their indexes but I don't have any idea that how to begin with this one in immutableJS.
I had something similar a long time ago... I used flatMap function. Eventually I modified my state structure as maintaining this code was a nightmare.