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

utils/lens-path
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns a lens whose focus is the specified path.

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

lensPath (path:Array) : Lens

Returns a lens whose focus is the specified path.

Example

var xHeadYLens = R.lensPath(['x', 0, 'y']);

     R.view(xHeadYLens, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
     //=> 2
     R.set(xHeadYLens, 1, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
     //=> {x: [{y: 1, z: 3}, {y: 4, z: 5}]}
     R.over(xHeadYLens, R.negate, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
     //=> {x: [{y: -2, z: 3}, {y: 4, z: 5}]}

Argument

path: Array

The path to use.

Returns

Lens