We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e10795e commit 907b387Copy full SHA for 907b387
src/App.js
@@ -68,17 +68,17 @@ const todoReducer = (state, action) => {
68
}
69
};
70
71
-const useCombinedReducer = useReducers => {
+const useCombinedReducer = combinedReducers => {
72
// Global State
73
- const state = Object.keys(useReducers).reduce(
74
- (acc, key) => ({ ...acc, [key]: useReducers[key][0] }),
+ const state = Object.keys(combinedReducers).reduce(
+ (acc, key) => ({ ...acc, [key]: combinedReducers[key][0] }),
75
{}
76
);
77
78
// Global Dispatch Function
79
const dispatch = action =>
80
- Object.keys(useReducers)
81
- .map(key => useReducers[key][1])
+ Object.keys(combinedReducers)
+ .map(key => combinedReducers[key][1])
82
.forEach(fn => fn(action));
83
84
return [state, dispatch];
0 commit comments