Sometimes we have data in a List that we want to key by some id const x = fromJS([
{
id: '12345',
n: 5
},
{
id: '56789',
n: 6
}
]); All we have to do is use the Map constructor const y = Immutable.Map(x.map(v => [v.get(‘id’), v])); And here is the output of y.toJS(): {
'12345': {
id: '12345',
n: 5
},
'56789': {
id: '56789',
n: 6
}
}