Skip to content

Commit

Permalink
fixed multiple action dispatches
Browse files Browse the repository at this point in the history
  • Loading branch information
sohamkamani committed May 30, 2016
1 parent f7bbe54 commit daa371d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .tern-project
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"ecmaVersion": 6,
"libs": [
"browser"
"browser",
"node"
],
"plugins": {
"node": {}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>

<head>
<title>MDL Dashboard</title>
<title>Todo MVC</title>
<meta charset="UTF-8">
</head>

Expand Down
4 changes: 3 additions & 1 deletion src/reducers/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const todos = (state = [], action) => {
case 'ADD_TODO':
return [
...state,
todo(undefined, action)
todo(undefined, Object.assign(action, {
id: state.length
}))
]
case 'TOGGLE_TODO':
return state.map(t =>
Expand Down
1 change: 0 additions & 1 deletion src/services/data-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const dataService = store => next => action => {
})
break
default:
next(action)
break
}

Expand Down

0 comments on commit daa371d

Please sign in to comment.