What is Redux?

Nov 5, 2017 00:00 · 114 words · 1 minute read

Redux is a JavaScript library that aims to manage stateful data. The state of your whole application is stored in a single JS object called store. A single function, the reducer, is responsible for making modifications to the store. We trigger the reducer by dispatching an action, a JS object that describes how our data should change. The reducer function receives the action as an argument and makes changes accordingly. Other parts of the code (usually React Components) can subscribe to data in the store. When data changes, Redux notifies subscribers of the change.

PS: The reducer is a pure function that takes the previous state and an action, and returns the next state.