That is not accurate. For example:
Netanel Basal
1

You’re right, shallowing copying won’t create a new reference for nested objects. The top-level reference will change though.

state === newState // false

The problem with your example is it doesn’t achieve isolation between state and newState, which is why Redux reducers can be error-prone without a library like ImmutableJS. I can mutate data in newState and it will mutate data in state as well and vice versa.

I will edit the wording to reflect your clarification. Thanks.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.