DEV Community

Snehendu Roy
Snehendu Roy

Posted on

Redux the easiest way [Part 2]

So in the 1st part we saw a story for understanding about redux. So what redux basically does is that it takes the data from other screens and those data can afterwards be rendered in other screens without any sort of prop drilling. So, it basically puts up the state to the steroid form.

Redux: Three Principles

  1. Store: The global state of your application is stored in a store from where the data flows through different screens and you can have access to them.

  2. Actions: The only way to change the state is to emit an action. In the example story of part 1, we saw that, your sister tells Clark to give the pizza then only Clark gives it to her. This 'call for pizza' is actually an action.

  3. Reducer: This is basically the function which is fired once an action is emmited. In the story, when your sister calls for the pizza, Clark checks the box and if there is a pizza for her he returns it. This whole thing that Clark is doing is an example of a reducer. This is kind of the brain of the redux.

Oldest comments (0)