import { Todo , TodoAction , TodoActions } from '../model/index' ; import { RootState } from '../reducers/index' ; export function addTodo ( todo ) { return { type : TodoActions . ADD_TODO , payload : todo , } ; } export function completeTodo ( todoId ) { return ( dispatch , getState ) => { dispatch ( { type : TodoActions . COMPLETE_TODO , payload : todoId } ) ; } ; } export function uncompleteTodo ( todoId ) { return { type : TodoActions . UNCOMPLETE_TODO , payload : todoId , } ; } export function deleteTodo ( todoId ) { return { type : TodoActions . DELETE_TODO , payload : todoId , } ; }