Redux explained as a private group conversation

Saurabh Mhatre
Frontend Weekly
Published in
8 min readApr 8, 2017

--

Image source: Pixabay

Like it or hate it, redux has become defacto state management system for complex reactjs and reactnative projects. However it does takes a little time to figure out the basic concepts and generate boilerplate code before one can use redux effectively in your next project and the official documentation seems a little daunting for people just starting their way into front end development. So I am writing this article to explain redux concepts by taking an analogy of a random group chat conversation as todo examples are old school and boring.

The three main components which make up redux are store,actions and reducers.Suppose you want to share some funny meme with your friends online. First thing you will need is a group containing all your friends to share your meme with them.In redux world this online group of your friends is called a store. It is a group to which all your friends(components) have subscribed to and it acts as a central repository to save all your group chat history. In redux world a store is an immutable entity which essentially means that a new copy of store is created on each update i.e. if someone posts some joke in your group all the subscribers(components) will receive a new copy of store with the new message appended at the end of chat history. The advantage is that you can see and control the state of store from initial state to final one…

--

--

Saurabh Mhatre
Frontend Weekly

Senior Frontend Developer with 9+ years industry experience. Content creator on Youtube and Medium. LinkedIn/Twitter/Instagram: @SaurabhNative