What is Redux

What is Redux?

Redux is an application state manager. It stores any modified state of the program in a single object. This object is immutable, that is that a new state (as a modification on the former state) is saved as a new version of state, not modifying the existing state. So every new state is:

new state = last state + modification

Why is this so useful

Sample 1. Caching

With a history of states available you can have great performance benefits. For example if you read a set of records from a server and browse through it, you could save the records in the view in a Redux store. You could easily browse through the pages you have already read from the server, by reading them from the Redux store. In that case you won't have to make server calls for data that you already got once.

Sample 2. Trigger events (ReactJS)

In ReactJS you can use Redux (react-redux) to eliminate ReactJS' own state, and control your application through a Redux store. By recording the state changes, you are able to trigger events by the use of actions and reducers. That gives you a large benefit to keep components dumber and still have maximum power of the changes in your views in your program.

Last update: Tue, 13 Sep 2022 14:32:15