lens.set
v0.0.1-alpha.2
Published
set(lens, value, data)
Downloads
1
Readme
lens.set
Similar to lodash.set
, but maintaining the immutability of data.
example
const helloWorld = {hello: [{place: 'world'}]}
const lensPath = ['hello', 0, 'place'];
const helloSingapore = set(lensPath, 'singapore', helloWorld);
console.log(helloSingapore); // {hello: [{place: 'singapore'}]}
console.log(helloWorld === helloSingapore); // false
properties
- properties inherited from
immutability-helper
- maintains immutability
- no autovivification
- maintains value if there is no change