0.0.1-alpha.2 • Published 7 years ago

lens.set v0.0.1-alpha.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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