Redux: Reducer Composition with combineReducers()
lessonDuration 2m 10s
Learn how to use combineReducers() utility function to generate a reducer from several other reducers instead of writing it by hand.
Browse
Find courses, lessons, articles, talks, and podcasts.
244 results for "redux"
Showing 145–168 · Page 7 of 11
lessonDuration 2m 10s
Learn how to use combineReducers() utility function to generate a reducer from several other reducers instead of writing it by hand.
lessonDuration 2m 47s
Learn how to implement toggling a todo in a todo list application reducer.
lessonDuration 4m 11s
Learn how to implement adding a todo in a todo list application reducer.
lessonDuration 2m 38s
Learn how to use Object.assign() and the spread operator proposed for ES7 to avoid mutating objects.
lessonDuration 3m 54s
Learn how to avoid mutating arrays using concat(), slice(), and the ES6 array spread operator.
lessonDuration 2m 36s
You will learn how to write the reducer for the counter application in a test driven development way, as well as the conventions in implementing reducers.
lessonDuration 2m 43s
We only have a few dispatching functions that need to be known by our React Application. Each one actually has multiple actions that need to be dispatched. While we could just have many imperative calls to dispatch in our dispatching functions, but why not use it as an excuse to use an array and write some middleware. We will create a middleware function that will check dispatched actions to see if they are arrays. If a given action is an array we loop over the array, dispatching each action in turn. If it is not however, we just pass it along to be handled downstream.
lessonDuration 2m 27s
A quick overview of what can be expected when going through this course.
lessonDuration 2m 12s
So far all of our actions have been implemented as a series of well timed events. We are also capable of not using any of our middleware and just dispatching a normal simple action with no frills or fuss. To complete this game out, we implement the simplest of our action dispatching functions to allow the player to restart the same once it has been concluded.
lessonDuration 2m 41s
Cypress doesn't provide out-of-the-box ability to make assertions on our frontend stores, so let's expose the store to the tests, and assert on it. We'll use our knowledge of Cypress's asynchronous programming style to access properties and functions on the store using cy.its and cy.invoke. Recommended Homework: - Consider why it's valuable to test against your frontend store when you can test against the UI
lessonDuration 2m 53s
There are times when we need to provide input to our action dispatching functions that we use as handlers. A great use case in our game is when the player selects one of the cards as their answer. We need to communicate which card was selected so our state can transition properly. To complicate the matter, when a player provides their answer, we want to fire a series of well times actions, with some of them needing this input. We have set up a nice pattern that will allow us to apply any arguments to any action created needed in a series of actions in an easy to follow manner.
lessonDuration 1m 49s
We will learn how to avoid the boilerplate code in mapDispatchToProps() for the common case where action creator arguments match the callback prop arguments.
lessonDuration 2m 34s
We will learn how to reduce the syntactic noise in the action creators and components when using arrow functions.
lessonDuration 2m 58s
We will learn how to use withRouter() to inject params provided by React Router into connected components deep in the tree without passing them down all the way down as props.
lessonDuration 5m 24s
We will learn how to wait until the item is updated on the server, and then update the corresponding local state.
lessonDuration 5m 36s
We will learn how to wait until the item is created on the server, and update the corresponding local state.
lessonDuration 10m 59s
We will learn how to handle an error inside an async action, display its message in the user interface, and offer user an opportunity to retry the action.
lessonDuration 4m 9s
We will learn how adding React Router shifts the balance of responsibilities, and how the components can use both at the same time.
lessonDuration 9m 33s
We will learn how moving the source of truth for the data to the server changes the state shape and the reducers in our app.
lessonDuration 6m 46s
We will learn how to normalize the state shape to ensure data consistency that is important in real-world applications.
lessonDuration 3m 46s
We will learn how to fire up an async request when the route changes.
lessonDuration 7m 58s
We will learn how to use normalizr to convert all API responses to a normalized format so that we can simplify the reducers.
lessonDuration 2m 25s
We will learn how to better separate the code in the entry point to prepare it for adding the router.
lessonDuration 7m 36s
We will learn how to use store.subscribe() to efficiently persist some of the app’s state to localStorage and restore it after a refresh.