Created
January 30, 2017 20:18
-
-
Save webrune-tim/9e2bd7aaecea89f60b1ae7f0e4e4c2d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import dispatcher from "../dispatcher"; | |
| export function addTodo(text) { | |
| dispatcher.dispatch({ | |
| type: "ADD_TODO", | |
| text, | |
| }); | |
| } | |
| export function deleteTodo(todoToDelete) { | |
| dispatcher.dispatch({ | |
| type: 'DELETE_TODO', | |
| todoToDelete, | |
| }); | |
| } | |
| export function toggleShowCompletedTodos() { | |
| dispatcher.dispatch({ | |
| type: 'TOGGLE_SHOW_COMPLETED_TODOS' | |
| }) | |
| } | |
| export function toggleShowIncompletedTodos() { | |
| dispatcher.dispatch({ | |
| type: 'TOGGLE_SHOW_INCOMPLETED_TODOS' | |
| }) | |
| } | |
| export function toggleTodo(todo) { | |
| dispatcher.dispatch({ | |
| type: 'TOGGLE_TODO', | |
| todo, | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment