Files
callstack__react-native-tes…/examples/redux/actions/todoActions.js
T
Kenneth Kwakye-Gyamfi ae3d4af370 docs: add Redux example (#291)
* Redux example

* Reviews implemented
2020-05-05 10:51:29 +02:00

26 lines
436 B
JavaScript

export const actions = {
ADD: '@ADD_TODO',
REMOVE: '@REMOVE_TODO',
MODIFY: '@MODIFY_TODO',
CLEAR: '@CLEAR_TODO',
};
export const addTodo = (todo) => ({
type: actions.ADD,
payload: todo,
});
export const removeTodo = (id) => ({
type: actions.REMOVE,
payload: { id },
});
export const modifyTodo = (todo) => ({
type: actions.MODIFY,
payload: todo,
});
export const clearTodos = () => ({
type: actions.CLEAR,
});