onwp / immutable-objects-with-immer

simple immer practice with produce method of it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

immutable-objects-with-immer

Simple immer practice with produce method of it.

First install the immer package from package.json just by writing npm install

After you installed the package, just run npm run start to see the original and updated objects.

Immer is used to generate new variables by including the items of immutable objects.

It is used in place of the spread operator, and it solves nested object spreading problem.

It also makes your code more readable.

The main purpose is to get the data from an immutable variable, and create a new variable with that data, and adding or overwriting some more data. This way the original constant or immutable object stays safe and untouched.

About

simple immer practice with produce method of it.


Languages

Language:JavaScript 100.0%