There are various utility libraries that help us to deal with immutable updates. The folowing is a short (incomplete) list of them:
- dot-prop-immutable: Provides helper functions that allow us to modify data via string paths; for example, state = dotProp.set(state, `todos.${index}.complete`, true)
https://github.com/debitoor/dot-prop-immutable
- immutability-helper: Uses objects with special operations to modify a state; for example, state = update(['x'], { $push: ['y'] })
https://github.com/kolodny/immutability-helper.
- immutable.js: If you want, you can use an immutable data structure altogether for your Redux store state; immutable.js data structures always return new instances instead of modifying data directly; for example, ...