Join Richard Gill for an in-depth discussion in this video Applying Redux reducers to the application, part of Performing Complex State Management with Redux.
- [Instructor] Applying Redux reducers to the application.…In this video, we're gonna have a look at how reducers work,…how to set them up, what they're there for.…So here is the post reducer,…which is the only reducer in this app.…So the first thing to note is that the store…is usually, in almost every Redux application…I've ever seen, the store is split by a reducer.…So you'll see a key, which is the name of each reducer.…You don't have to do it like that, but nearly everyone does,…so let's just kind of say that that's just how it works.…
At its core, a reducer is a function.…So this is a reducer here,…and let's go through this bit by bit.…So the first thing is state is a parameter,…which is often assigned to an initial state,…we'll come back to that, and an action.…Now what happens is every time…an action is dispatched, this code runs.…And the action is the action that's being dispatched,…funnily enough, and the state…is the existing state of just this reducer.…So, I'm gonna start off just by console logging, I think.…
Released
7/5/2018Note: This course was created by Packt Publishing.
- What is Redux?
- Connecting your components to the store
- Firing actions
- Applying Redux reducer
- Using advanced reducers
- Dispatching asynchronous actions with Thunk
- Building a workable application
Share this video
Embed this video
Video: Applying Redux reducers to the application