Rémy Villulles
1 min readMay 17, 2020

--

When your reducer returns the new state, there is a last step before everything is updated.

Redux will do a deep copy of the existing global store and assign it to a new variable (new reference). It will then, on this deep copy, merge with the state returned by the reducer. Once the merge is done, the store takes the new references and the UI updates.

This is done to avoid having a moment where some values are A and some others are B. Redux is fully asynchronous and you don’t want to access invalid data

--

--

Rémy Villulles
Rémy Villulles

Written by Rémy Villulles

Fullstack developer, I love learning new technologies and try to stay up to date with the newest features

No responses yet