-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use more ES6 syntaxes in the todomvc example
- Loading branch information
1 parent
4b9216b
commit 27d9a24
Showing
12 changed files
with
83 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
import * as types from '../constants/ActionTypes' | ||
|
||
export function addTodo(text) { | ||
return { type: types.ADD_TODO, text } | ||
} | ||
export const addTodo = text => ({ type: types.ADD_TODO, text }) | ||
|
||
export function deleteTodo(id) { | ||
return { type: types.DELETE_TODO, id } | ||
} | ||
export const deleteTodo = id => ({ type: types.DELETE_TODO, id }) | ||
|
||
export function editTodo(id, text) { | ||
return { type: types.EDIT_TODO, id, text } | ||
} | ||
export const editTodo = (id, text) => ({ type: types.EDIT_TODO, id, text }) | ||
|
||
export function completeTodo(id) { | ||
return { type: types.COMPLETE_TODO, id } | ||
} | ||
export const completeTodo = id => ({ type: types.COMPLETE_TODO, id }) | ||
|
||
export function completeAll() { | ||
return { type: types.COMPLETE_ALL } | ||
} | ||
export const completeAll = () => ({ type: types.COMPLETE_ALL }) | ||
|
||
export function clearCompleted() { | ||
return { type: types.CLEAR_COMPLETED } | ||
} | ||
export const clearCompleted = () => ({ type: types.CLEAR_COMPLETED }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters