import { TodosAction , TodosActionTypes , } from '../../types/redux/todos-reducer-types' ; Action function param { string } todoText returns { function } export const addNewTodo = ( todoText ) : TodosAction => ( { type : TodosActionTypes . ADD_TODO , payload : { id : String ( Math . floor ( Math . random ( ) * Date . now ( ) ) ) , todoText , isHighlighted : false , isCompleted : false , } , } ) ; Action function param { string } todoID returns { function } export const markTodoCompleted = ( todoID ) : TodosAction => ( { type : TodosActionTypes . MARK_TODO_COMPLETED , payload : todoID , } ) ; Action function param { string } todoID returns { function } export const markTodoHighlighted = ( todoID ) : TodosAction => ( { type : TodosActionTypes . MARK_TODO_HIGHLIGHTED , payload : todoID , } ) ; Action function param { string } todoID returns { function } export const deleteTodo = ( todoID ) : TodosAction => ( { type : TodosActionTypes . DELETE_TODO , payload : todoID , } ) ;