File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ interface AddTodoAction extends Action {
11
11
}
12
12
13
13
14
- const todosReducer : Reducer < TodosState > = ( state : TodosState ,
15
- action : Action ) : TodosState => {
16
- switch ( action . type ) {
17
- case 'ADD_TODO' :
18
- return [ ...state , ( < AddTodoAction > action ) . text ]
19
- default :
20
- return state
14
+ const todosReducer : Reducer < TodosState , AddTodoAction > =
15
+ ( state , action ) => {
16
+ switch ( action . type ) {
17
+ case 'ADD_TODO' :
18
+ return [ ...state , action . text ]
19
+ default :
20
+ return state
21
+ }
21
22
}
22
- }
23
23
24
24
const todosState : TodosState = todosReducer ( [ ] , {
25
25
type : 'ADD_TODO' ,
@@ -48,7 +48,7 @@ type RootState = {
48
48
}
49
49
50
50
51
- const rootReducer : Reducer < RootState > = combineReducers ( {
51
+ const rootReducer = combineReducers < RootState , Action | AddTodoAction > ( {
52
52
todos : todosReducer ,
53
53
counter : counterReducer ,
54
54
} )
You can’t perform that action at this time.
0 commit comments