I’ve Cracked the Code, Please Call Tech Support- Episode 29, The State in the Mind’s Server

Redux is still an interesting beast, beast though it is. I’ve picked up some books on the subject (thanks, Humble Bundle!), so I’m hoping to keep momentum up on relearning the basics to build up my skill-set.

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

The value of working ahead. I managed to knock out most of my class work for this week by Monday, and that’s giving me the time I need to really focus on learning in the way that I learn best- head down, working on various projects.

2. What are “actions” in Redux?

Actions carry our information for the store. Think “I’m hungry”, rather than “I eat”. It informs why we are going to the store, and passes that information through so that our reducer, “eat”, can do it’s thing.

3. What is the role of reducers in Redux?

A reducer is a function that determines changes to an application’s state, as per css-tricks.com. In the example that we’ve been using here, this “how we eat” function tells is how the state can change from “has food” to “has eaten food”.

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

The whole application is being stored in a single object, called the “state tree”. This is our source for truth, which can be utilized by our various components.

5. Explain the components of Redux.

We’ve got four components that are specific to Redux, and we’ve spoken about them previously:

I. Store- Our grocery store, where we keep our state information.

II. Action- Our driving force, our “I’m hungry”. It tells us why we’re doing these things and passes that on to our reducer. On that note…

III. Reducer- The function that determines changes to an application’s state, how we can eat food.

IV. Dispatch- Eat the food.

6. Which (if there is) node library method could you use to solve the algorithm problem you solved last night in your pre-homework?

useState allows us to, naturally, change the state in a functional, rather than class-based component. This is helpful, and from what I’ve been able to glean is now the industry standard.

7. Which (if there is) node library method could you use to solve the algorithm problem you solved last night?

No project homework this go around, I’m afraid. I’m going to be hitting the books hard in order to keep applying these principles that I am learning. This will make my life easier later.