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

utils/lens
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns a lens for the given getter and setter functions

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

lens (getter:Function, setter:Function) : Lens

Returns a lens for the given getter and setter functions. The getter “gets” the value of the focus; the setter “sets” the value of the focus. The setter should not mutate the data structure.

Example

var xLens = R.lens(R.prop('x'), R.assoc('x'));

     R.view(xLens, {x: 1, y: 2});            //=> 1
     R.set(xLens, 4, {x: 1, y: 2});          //=> {x: 4, y: 2}
     R.over(xLens, R.negate, {x: 1, y: 2});  //=> {x: -1, y: 2}

Arguments

getter: Function

setter: Function

Returns

Lens