lens.set

0.0.1-alpha.2 • Public • Published

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

/lens.set/

    Package Sidebar

    Install

    npm i lens.set

    Weekly Downloads

    1

    Version

    0.0.1-alpha.2

    License

    MIT

    Last publish

    Collaborators

    • alvinsj