Created
July 20, 2020 18:09
-
-
Save bismitaguha/71c0a6359438535824300442a345ec96 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* action types | |
*/ | |
export const ADD_TODO = 'ADD_TODO' | |
export const TOGGLE_TODO = 'TOGGLE_TODO' | |
export const SET_VISIBILITY_FILTER = 'SET_VISIBILITY_FILTER' | |
/* | |
* other constants | |
*/ | |
export const VisibilityFilters = { | |
SHOW_ALL: 'SHOW_ALL', | |
SHOW_COMPLETED: 'SHOW_COMPLETED', | |
SHOW_ACTIVE: 'SHOW_ACTIVE' | |
} | |
/* | |
* action creators | |
*/ | |
export function addTodo(text) { | |
return { type: ADD_TODO, text } | |
} | |
export function toggleTodo(index) { | |
return { type: TOGGLE_TODO, index } | |
} | |
export function setVisibilityFilter(filter) { | |
return { type: SET_VISIBILITY_FILTER, filter } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment