What is Redux?

Adhikansh Mittal
SIAM-VIT
Published in
5 min readSep 17, 2019

hey, there everyone I am Adhikansh back again with another blog and in this blog I would like to explain you the concept of Redux. I will explain you the theoretical concept about what is Redux and how you can understand it properly before you dive and create multiple reducers and get find yourself completely lost into what actually Redux is and why it is used for I’m planning to make couple of blogs on what is subject first let’s dive into the redux thing and then I explain a little bit things at the end of the blog.

so redux is really an amazing library in the JavaScript world very popular in the domain of react and react native and it is kind of a compulsory go-to thing for every react and react native developer understanding the concept of react and redux is kind of a go hand-in-hand So in this blog. I’ll explain the redux three times I know this is too much but just bear with me for a minute and you will be singing what is Redux before me by the end of this blog. so let’s go ahead and try to understand what is this Redux?

I’m gonna give you a simple example of completely unrelated thing and then we are going to relate that with the redux so just try to assume you live in a country so how do you change a law in that country let’s just say there is some law which is completely ridiculous and you want to change that it’s not like you just go ahead and change the law in your notebook that doesn’t happen so as an ordinary people what you do is whenever you want to make a change in law you directly don’t change in law first and foremost you create some kind of a protest because without doing the protest nobody listens to you and you make a noise to make sure that these things are being understood and are taken seriously so you’re doing all this protests to change a certain law now obviously just by protesting against this law is not gonna make anything and again I’m offering here peaceful protest so what do you do when these laws and these products go quite a long then what happens is these things actually reaches out to your Minister or your senate’s who actually can modify these laws again you

cannot modify, your laws just in your notebook similarly ministers cannot also just modify these laws in their notebook they have to go some place known as Parliament in different countries it’s different thing but ministers propose and actually these ministers have power to amend these laws and again in most of the parliaments we don’t completely delete any law we just simply like to amend this law or make some modification and again you can always look back in the history and can find out what was that law in like 1930s and then 1940s what was what was the law so this is all the thing happens up here.

I know this is a weird story but just bear with me for a minute more so what happens now notice here I have graded out a little bit that means only ministers has power to make a proposed statement there that I want to change a certain law now still we don’t have any connection with people of this Parliament there is definitely a cycle but there is no direct connection between Parliament and people so that Parliament can notify that we have changed the law so for that particular thing this Parliament actually notifies something known as newspaper or maybe TV agencies now these TV agencies play a kind of double role they are subscribed to the parliament through a notification because they let just say are sending some reporters to keep an eye on the parliament and just goes like that now in the similar way we are also subscribed to these newspaper which passes of the update and completes the cycle of how people gets the update so that’s my one time explanation.

I’ll repeat that this is the second time so people protest for a certain law and they just move to the ministers who actually have the power to change something they propose the statement to the Parliament and then it is being notified to newspaper and then newspaper passes us the update as a journal to the people that the news is here and we have modified the law now this is actually your redux believe it or not.

so what is the redux actually in the Redux concept we goes exactly same just the things changes a little bit so what happens is we have the components instead of the people so instead of protesting what they try to do is they try to dispatch a certain thing which is known as action now of course just dispatching the action is not gonna do anything now these action actually reaches to reducers there can be multiple reducers there can be just one so when these action actually reaches to the reducers has the power to change something now these reducers go to something known as central store which manages all the state of the application and these central stores once they are being changed they actually send a trigger to something known as subscriptions and this subscription then finally notifies or instead we can say passes updated states as props to the component really simple, again component dispatches an action to the reducers and then reduces has the power to change the certain things and they have to change in the central store only because that’s the place where everything goes up this sends a trigger to the subscription and subscription passed that states as a props to the component.

Now I think you get an idea about redux. I will write more blogs explaining the redux with the help of code in near future about redux till then keep tuned.

Happy Coding!

--

--