educative.io

Educative

State versioning in Redux

Are there multiple state histories stored in a tree for versioning or is the current state the only thing that is stored?

Whenever your application starts, the Redux Store contains the initial state. From there onwards, the latest version of the state object is present in the Store. In that sense, no, version history is not stored by the Redux Store.
However, there are other ways of keeping track of your previous states:

  • Snapshots
  • Making state history a part of the state object

If you have a general idea about Redux, here’s a really helpful link from the official Redux site:
https://redux.js.org/recipes/implementingundohistory