deepmerge
deepmerge copied to clipboard
Clarify in docs this supports immutable-object pattern
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
It's not clear without testing that this doesn't modify the input.
Documenting this explicitly could boost adoption among people looking for a library compatible with immutable data structures. Maybe a description similar to https://immerjs.github.io/immer/#immer-simplifies-handling-immutable-data-structures
Motivation
No response
Example
const a = { a: 'value' }
const b = { b: 404 }
const result = deepMerge()(a, b);
console.log(result); // {a: 'value', b: 404 }
console.log(a); // {a: 'value'}
console.log(b); // {b: 404}
console.log(a === result); // false
console.log(b === result); // false
If you like you can provide a PR.