You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code for the first implementation of `todos` as an example of reducer composition is actually the same as the previous example, causing the following paragraph ("This is called *reducer composition*, and it’s the fundamental pattern of building Redux apps") to make no sense.
This change adds the `todos` function from the following example to make this one more clear.
There are other ways the composition could be done, certainly, and I'm not sure that the one I chose is the most iconic, so feel free to suggest alternatives. :-)
Copy file name to clipboardExpand all lines: docs/basics/Reducers.md
+27-18Lines changed: 27 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -199,32 +199,41 @@ function todoApp(state = initialState, action) {
199
199
Is there a way to make it easier to comprehend? It seems like `todos` and `visibilityFilter` are updated completely independently. Sometimes state fields depend on one another and more consideration is required, but in our case we can easily split updating `todos` into a separate function:
0 commit comments