Open Methuselah96 opened 4 years ago
From @ztoben on Tue, 04 Jun 2019 17:43:23 GMT
We ran into a strange behavior when using mergeIn with an empty object.
When doing a mergeIn on any map, if the map being merged in is empty, ie {} or Map({}), then it doesn't seem to get merged at all.
mergeIn
{}
Map({})
Either this is intended behavior and not documented well, or it seems to be a bug.
const foo = Map({}); const bar = foo.mergeIn(['baz'], {}); console.log(bar.toJS());
Expected output: {baz: {}}
{baz: {}}
Actual output: {}
Copied from original issue: https://github.com/immutable-js/immutable-js/issues/1715
From @ztoben on Tue, 04 Jun 2019 17:43:23 GMT
What happened
We ran into a strange behavior when using mergeIn with an empty object.
When doing a
mergeIn
on any map, if the map being merged in is empty, ie{}
orMap({})
, then it doesn't seem to get merged at all.Either this is intended behavior and not documented well, or it seems to be a bug.
How to reproduce
Expected output:
{baz: {}}
Actual output:
{}
Copied from original issue: https://github.com/immutable-js/immutable-js/issues/1715