Share your code. Components are building blocks, you are the architect.

utils/merge-with-key
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Creates a new object with the own properties of the two provided objects

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/merge-with-key in your project
npm i @bit/bit.ramda.utils.merge-with-key
Copied

mergeWithKey (fn:Function, l:Object, r:Object) : Object

Creates a new object with the own properties of the two provided objects. If a key exists in both objects, the provided function is applied to the key and the values associated with the key in each object, with the result being used as the value associated with the key in the returned object.

Example

let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r
     R.mergeWithKey(concatValues,
                    { a: true, thing: 'foo', values: [10, 20] },
                    { b: true, thing: 'bar', values: [15, 35] });
     //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }

Arguments

fn: Function

l: Object

r: Object

Returns

Object