Exploring Redux

Meredith Davis
Oct 25, 2020

Blogpost 406

Discuss in words something you learned in class today or this week.

This week we learned about Redux-Thunk, how to use the middleware to effectively allow our action creators to return functions instead of objects.

What are “actions” in Redux?

Actions are payloads of information that send data from your application to your store. They are the only source of information for the store.

What is the role of reducers in Redux?

A reducer is a function that determines changes to an application’s state. It uses the action it receives to determine this change.

What is the meaning of “single source of truth” in Redux?

In React-Redux applications, when your Redux is a single source of truth, it means that the only way to change your data in UI is to dispatch a redux action which will change state within redux reducer.

Explain the components of Redux.

Redux has 4 components, Store, Reducer, Action and Middleware.

Store- A redux store holds the complete tree state of your app.

Reducer- A reducer is a pure function, which returns the state of the application based on the action dispatched by the store.

Action- The action is the payload information that transmits data from the application to the store.

Middleware- Middlewares are used to dispatch async functions, and run everytime a certain action happens.

--

--

Meredith Davis
0 Followers

Former Kindergarten Teacher, now a student at Austin Code Academy learning Front Stack Web Development