|
|
@ -190,6 +190,10 @@ function reducer(state, action) { |
|
|
|
return {count: state.count + 1}; |
|
|
|
case 'decrement': |
|
|
|
return {count: state.count - 1}; |
|
|
|
default: |
|
|
|
// A reducer must always return a valid state. |
|
|
|
// Alternatively you can throw an error if an invalid action is dispatched. |
|
|
|
return state; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -223,6 +227,10 @@ function reducer(state, action) { |
|
|
|
return {count: state.count + 1}; |
|
|
|
case 'decrement': |
|
|
|
return {count: state.count - 1}; |
|
|
|
default: |
|
|
|
// A reducer must always return a valid state. |
|
|
|
// Alternatively you can throw an error if an invalid action is dispatched. |
|
|
|
return state; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|