The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Angular 1.x Redux: Handle State Mutations with Reducers

Angular 1.x Redux: Handle State Mutations with Reducers

9:52
In this lesson, we are are going to learn how to abstract out state mutations into a reducer. In our current Eggly application, all of the state and business logic for our categories is handled within the categories model. We are going to refactor our code to entirely eliminate the need for our categories model by building out a couple of reducers and seeing how we can interact with them directly. The key thing to notice as we build out our reducers is that a reducer itself is completely stateless because it receives current state every single time it needs to calculate and return the new state. With a clearly defined contract of inputs and outputs, this makes testing reducers really easy which is one of the huge benefits of using this approach.
Watch this lesson now
Avatar
egghead.io

In this lesson, we are are going to learn how to abstract out state mutations into a reducer. In our current Eggly application, all of the state and business logic for our categories is handled within the categories model. We are going to refactor our code to entirely eliminate the need for our categories model by building out a couple of reducers and seeing how we can interact with them directly.
The key thing to notice as we build out our reducers is that a reducer itself is completely stateless because it receives current state every single time it needs to calculate and return the new state. With a clearly defined contract of inputs and outputs, this makes testing reducers really easy which is one of the huge benefits of using this approach.

Avatar
Paul

Just started on this. Exactly what I have been interested in learning about. I am having one stumbling block however, I am not understanding how webpack is serving the bundle.js. I can't see any kind of generated files once I have gulp running. Could you please direct me to some resources that might explain how this is working?

Avatar
Lukas

We are using Browsersync to serve up our application which you see in the gulp.serve task. Pay special attention to the middleware tasks that leverage Webpack.

In reply to Paul
Avatar
Michael

Where is the code for this module?

Avatar
Brutalis

look at the code tab, the link to the github page is there. Also make sure to use the branch start.

In reply to Michael
Avatar
Brutalis

What kind of plugin do you use for code completion?

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?