Created
April 9, 2020 22:29
-
-
Save LarryKarani/5e99946c13e304c85131609dc0b0b28d 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 API_REQUEST = 'API_REQUEST'; | |
export const GET_TODO_SUCCESS = 'GET_TODO_SUCCESS'; | |
export const GET_TODO_FAIL = 'GET_TODO_FAIL'; | |
export const ADD_TODO_SUCCESS = 'ADD_TODO_SUCCESS'; | |
export const ADD_TODO_FAIL = 'ADD_TODO_FAIL'; | |
//ACTION CREATORS | |
export const apiRequestAction = () => ({ | |
type: API_REQUEST | |
}); | |
export const getTodoSuccess = todos => ({ | |
type: API_REQUEST, | |
payload: todos | |
}); | |
export const getTodosFail = error => ({ | |
type: GET_TODO_FAIL, | |
payload: error | |
}) | |
export const addTodoSuccess = todo => ({ | |
type: ADD_TODO_SUCCESS, | |
payload: todo | |
}) | |
export const addTodoFail = error => ( | |
{ | |
type: ADD_TODO_FAIL, | |
payload: error | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment