-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency logic behavior between mergeWith & mergeDeepWith #9
Comments
Migrated from don't reference! @vpcvdc Can you expound on what you think the inconsistent behavior is? It looks like it is working correctly to me. The first example only goes one layer deep, so it ends up calling The second and third examples go all the way to the deepest layer and since arrays get merged together, it ends up merging the arrays together and returning an object without calling To clarify, in both |
Migrated from don't reference! As per document says
In the above screenshot, In the above screenshot, mergeDeepWith behaving like mergeDeep 😳 I hope you get the clarity, what I really mean 🙂 |
Migrated from don't reference! @vpcvdc I don't think that arrays are considered values in this case. The merger function isn't called on objects or arrays EXCEPT in the case where we're more than one layer deep in For example the merger function is called on objects here (similar to how they were called on arrays in your first example): |
Migrated from don't reference! I'm trying to pick apart what's going on here. To start with the docs are wrong. There is no such method as To fix this we need to either remove And of course the situation is the same for |
Migrated from don't!
Originally created by @vpcvdc on Tue, 07 Jul 2020 06:43:07 GMT
What happened
mergeWith working fine as per https://immutable-js.github.io/immutable-js/docs/#/mergeWith docs.
mergeDeepWith NOT working fine as per https://immutable-js.github.io/immutable-js/docs/#/mergeDeepWith.
It says like mergeDeepWith is recursive implementation of mergeWith. @leebyron Isn't it?
How to reproduce
The text was updated successfully, but these errors were encountered: