Created
September 5, 2017 09:38
-
-
Save chuyihuang/2e4cad81ba87595efd7b8e635e69701f to your computer and use it in GitHub Desktop.
week_4_demo_1
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
//actions改為thunk版本 | |
import * as Types from '../types'; | |
export function addTodo(todo) { | |
return (dispatch) => { | |
dispatch({ | |
type: Types.ADD_TODO, | |
payload: todo, | |
}) | |
} | |
} | |
export function toggleTodo(todo) { | |
return (dispatch) => { | |
dispatch({ | |
type: Types.TOGGLE_TODO, | |
payload: todo, | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment