Skip to content

Instantly share code, notes, and snippets.

@qvil
Created August 8, 2021 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qvil/0e272440648e3bcf068cd07c6229f184 to your computer and use it in GitHub Desktop.
Save qvil/0e272440648e3bcf068cd07c6229f184 to your computer and use it in GitHub Desktop.
Example actions for request, success, failure pattern
const GET_DATA_REQUEST = "GET_DATA_REQUEST";
const GET_DATA_SUCCESS = "GET_DATA_SUCCESS";
const GET_DATA_FAILURE = "GET_DATA_FAILURE";
const getDataRequest = (data) => ({
type: GET_DATA_REQUEST,
data,
});
const getDataSuccess = (data) => ({
type: GET_DATA_SUCCESS,
data,
});
const getDataFailure = (data) => ({
type: GET_DATA_FAILURE,
data,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment