Skip to content

Commit df5ee6b

Browse files
committed
Merge pull request reduxjs#1085 from xcatliu/xcatliu-troubleshooting-fix
Update Troubleshooting.md
2 parents 4615107 + 31ad170 commit df5ee6b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/Troubleshooting.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ function todos(state = [], action) {
2626
text: action.text,
2727
completed: false
2828
})
29+
return state
2930
case 'COMPLETE_TODO':
3031
// Wrong! This mutates state[action.index].
3132
state[action.index].completed = true
33+
return state
34+
default:
35+
return state
3236
}
33-
34-
return state
3537
}
3638
```
3739

@@ -43,7 +45,7 @@ function todos(state = [], action) {
4345
case 'ADD_TODO':
4446
// Return a new array
4547
return [
46-
...state,
48+
...state,
4749
{
4850
text: action.text,
4951
completed: false

0 commit comments

Comments
 (0)