I'm just starting with immutable.js and I'm having trouble figuring out how to set a new property on objects within an array. I'm having trouble finding any examples in the docs of this kind of change.
I'm basically just trying to take change this:
[{
gitInfo: {id: 8001, host: '', …},
module: {id: 24875, name: "blah", …}
}...]
to this:
[{
gitInfo: {id: 8001, host: '', …},
module: {id: 24875, name: "blah", isStared: true …}
}...]
So w/out immutable.js I would have something like:
function markModules(modules) {
modules.map( (module) => {
module.module.isStarred = false;
if (contains(this.props.stars, module.module.id)) {
module.module.isStarred = true;
}
})
return modules;
}
I'm assuming I need something like set() with a List, but again, I'm not finding any examples how to do this.
Thanks for any tips or links to examples.