2018-12-22 17:20:04 +03:00
|
|
|
import * as types from '../constants/ActionTypes';
|
|
|
|
|
|
|
|
export function addTodo(text) {
|
|
|
|
return {
|
|
|
|
type: types.ADD_TODO,
|
2020-08-08 23:26:39 +03:00
|
|
|
text,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function deleteTodo(id) {
|
|
|
|
return {
|
|
|
|
type: types.DELETE_TODO,
|
2020-08-08 23:26:39 +03:00
|
|
|
id,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function editTodo(id, text) {
|
|
|
|
return {
|
|
|
|
type: types.EDIT_TODO,
|
|
|
|
id,
|
2020-08-08 23:26:39 +03:00
|
|
|
text,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function markTodo(id) {
|
|
|
|
return {
|
|
|
|
type: types.MARK_TODO,
|
2020-08-08 23:26:39 +03:00
|
|
|
id,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function markAll() {
|
|
|
|
return {
|
2020-08-08 23:26:39 +03:00
|
|
|
type: types.MARK_ALL,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function clearMarked() {
|
|
|
|
return {
|
2020-08-08 23:26:39 +03:00
|
|
|
type: types.CLEAR_MARKED,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
}
|