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

utils/assoc-path
v1.0.0
1.0.0
MIT
PUBLIC
0
Build: none
BuildNone
Makes a shallow clone of an object, setting or overriding the nodes required

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/assoc-path in your project
npm i @bit/bit.ramda.utils.assoc-path
Copied

assocPath (path:Array, val:*, obj:Object) : Object

Makes a shallow clone of an object, setting or overriding the nodes required to create the given path, and placing the specific value at the tail end of that path. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference.

Example

R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}

     // Any missing or non-object keys in path will be overridden
     R.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}

Arguments

path: Array

the path to set

val: *

The new value

obj: Object

The object to clone

Returns

Object

A new object equivalent to the original except along the specified path.