File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 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 {
1111}
1212
1313
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+ }
2122 }
22- }
2323
2424const todosState : TodosState = todosReducer ( [ ] , {
2525 type : 'ADD_TODO' ,
@@ -48,7 +48,7 @@ type RootState = {
4848}
4949
5050
51- const rootReducer : Reducer < RootState > = combineReducers ( {
51+ const rootReducer = combineReducers < RootState , Action | AddTodoAction > ( {
5252 todos : todosReducer ,
5353 counter : counterReducer ,
5454} )
You can’t perform that action at this time.
0 commit comments