Skip to content

Instantly share code, notes, and snippets.

@qvil
Created August 8, 2021 03:48
Show Gist options
  • 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