Since you mentioned Redux, there's an official abstraction that handles immutability for you in a very ergonomic way, it uses immer.js internally which is also another great immutability library.
The official, opinionated, batteries-included toolset for efficient Redux development
Redux Toolkit
The official, opinionated, batteries-included toolset for efficient Redux development
(Formerly known as "Redux Starter Kit")
Installation
Using Create React App
The recommended way to start new apps with React and Redux Toolkit is by using the official Redux+JS template for Create React App, which takes advantage of React Redux's integration with React components.
npx create-react-app my-app --template redux
An Existing App
Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:
It is also available as a precompiled UMD package that defines a window.RTK global variable
The UMD package can be used as a <script> tag directly.
Purpose
The Redux Toolkit package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:
Yes, immer is a great library and with redux you can do amazing things but in general, immer try to solve too many problems(patches, async usage). So immutable-helpers for me more intuitive and simple approach with single responsibility and zero threshold
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Since you mentioned Redux, there's an official abstraction that handles immutability for you in a very ergonomic way, it uses immer.js internally which is also another great immutability library.
reduxjs / redux-toolkit
The official, opinionated, batteries-included toolset for efficient Redux development
Redux Toolkit
The official, opinionated, batteries-included toolset for efficient Redux development
(Formerly known as "Redux Starter Kit")
Installation
Using Create React App
The recommended way to start new apps with React and Redux Toolkit is by using the official Redux+JS template for Create React App, which takes advantage of React Redux's integration with React components.
An Existing App
Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:
It is also available as a precompiled UMD package that defines a
window.RTK
global variable The UMD package can be used as a <script> tag directly.Purpose
The Redux Toolkit package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:
immerjs / immer
Create the next immutable state by mutating the current one
Immer
Create the next immutable state tree by simply modifying the current tree
Winner of the "Breakthrough of the year" React open source award and "Most impactful contribution" JavaScript open source award in 2019
Contribute using one-click online setup
You can use Gitpod (a free online VS Code like IDE) for contributing online. With a single click it will launch a workspace and automatically:
yarn run start
.so that you can start coding straight away.
Documentation
The documentation of this package is hosted at immerjs.github.io/immer/
Support
Did Immer make a difference to your project? Join the open collective at opencollective.com/immer!
Release notes
github.com/immerjs/immer/releases
Yes, immer is a great library and with redux you can do amazing things but in general, immer try to solve too many problems(patches, async usage). So immutable-helpers for me more intuitive and simple approach with single responsibility and zero threshold