-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
848e7d6
commit 8eea975
Showing
13 changed files
with
2,203 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015", "react"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* action 类型 | ||
*/ | ||
|
||
export const ADD_TODO = 'ADD_TODO'; | ||
export const COMPLETE_TODO = 'COMPLETE_TODO'; | ||
export const SET_VISIBILITY_FILTER = 'SET_VISIBILITY_FILTER' | ||
|
||
/* | ||
* 其它的常量 | ||
*/ | ||
|
||
export const VisibilityFilters = { | ||
SHOW_ALL: 'SHOW_ALL', | ||
SHOW_COMPLETED: 'SHOW_COMPLETED', | ||
SHOW_ACTIVE: 'SHOW_ACTIVE' | ||
}; | ||
|
||
/* | ||
* action 创建函数 | ||
*/ | ||
|
||
export function addTodo(text) { | ||
return { type: ADD_TODO, text } | ||
} | ||
|
||
export function completeTodo(index) { | ||
return { type: COMPLETE_TODO, index } | ||
} | ||
|
||
export function setVisibilityFilter(filter) { | ||
return { type: SET_VISIBILITY_FILTER, filter } | ||
} |
Oops, something went wrong.