Hello Mark, thanks for taking time to respond.
Rajat Saxena
1

An “action” is simply a plain JS object with a type field, like: {type : "ADD_TODO", text : "Buy milk"}. I’m not sure what you mean by “my app receives a new message”, unless you’re talking about something like a Websocket connection to a server.

One of the main points of Redux is that most of your application’s data should be put together into a single “state tree” object, and that the only part of the application’s code that is allowed to make updates to the state tree are the “reducer functions” you provide. The only way to make those reducer functions run is to call store.dispatch(someActionObject). That way, when you want to know _when_ and _why_ a certain part of the state was updated, you can look at the reducers to see what reducer is responsible for updating that part of the state tree, see what actions it listens for, and look at your app to see what places that action is dispatched.

There’s usually two main aspects about Redux that learners find confusing. One is the use of Functional Programming principles, like “immutability” and “pure functions” with no “side effects”. The other is the terminology and concepts like “reducers” and “actions”.

I’d encourage you to take a look at Dan Abramov’s simple explanation of how Redux works in the “Core Concepts” docs page, and watch his video tutorial series on Egghead. Also, take a look at the “getting started” list of Redux tutorial links on the front page of my list, as well as the larger list of Redux tutorials. Finally, please feel free to come by the Reactiflux chat channels and ask questions.

Hopefully that helps!

Like what you read? Give Mark Erikson a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.