DEV Community

Snehendu Roy
Snehendu Roy

Posted on

Redux The Easiest Way [Part 1]

What is redux?

Well in the web if you search for this question then you might see that redux is a state management tool which helps up to manage the state of the application.

Now you will think what the heck now is the state

To understand this, let's take an example of a building. Suppose there are 5 floors in the building. Then there is a lift in that building.

There is a person named Clark in that building who takes stuff from each floor, stores it in a box (which is present in that lift).

Now let's take a case:
You are standing with a box of pizza in the ground floor and your sister is in the 3rd floor whom you want to give the pizza. Now you will give the pizza to Clark and he will store it in the box. Then your sister will order clark to give her the pizza you bought and clark will deliver it to you.

Now, your sister needs to give a watch that she bought for your father who lives in the 1st floor. She will give the watch to Clark. When your father asks about the watch, Clark will hand it to him.

Now where is redux in this story?

The building is your app. The lift system, including Clark, the box is actually redux. You, your sister, your father are the screens in your app. And the pizza, watch are data.

So basically what redux is doing is that it is helping to pass the data between the screens of your app.

This is why redux is required. Take redux as a system which helps you to store data and that data can be accessed by any of the screens you want. This is why redux can be even a lifesaver for you.

Top comments (0)