Consider the following example:
const stickers =
new OrderedMap().set(1, {hero: "batman", name: "Bruce"});
stickers.getIn([1]); //=> { hero: 'batman', name: 'Bruce' }
stickers.getIn([1, "hero"]); //=> undefined
Why is the result of that second getIn undefined?
The docs on ImmutableJS state:
Plain JavaScript Object or Arrays may be nested within an Immutable.js Collection, and getIn() can access those values as well
Therefore, it follows that it makes no difference if value of the OrderedMap is a plain javascript object or an Immutable collection - however we can see that the bug goes away if we convert that plain object to an Immutable Collection first:
const stickers =
new OrderedMap().set(1, fromJS({hero: "batman", name: "Bruce"}));
stickers.getIn([1]); //=> { hero: 'batman', name: 'Bruce' }
stickers.getIn([1, "hero"]); //=> 'batman'