How is state immutability actually used in Redux?

Viewed 339

I am trying to understand how immutability is actually (if at all) used in Redux. Every tutorial/article/document I found states that reducers should never alter the state object but instead create a new copy of the changed data (i.e. the reducers must be pure functions). I understand this but I could not find any place where there is an explanation of how this guideline is actually used by Redux internal implementation.

Is this just a strong recomendation or will something inside Redux breaks if I make the reducers non pure?

If it is the later then what exactly will break?

I did find several places where Dan says that in some (very rare) cases the reducers may be non pure but it is risky (again, with no explanation what is the risk exactly).

1 Answers
Related