Skip to content

Instantly share code, notes, and snippets.

@brownsmith
Last active Mar 18, 2020
Embed
What would you like to do?
Redux action types, actions and action creators
// action type
const orderCardType = 'ORDER_CARD';
// action
const orderCardAction = () => ({
type: orderCardType,
});
// action creator
const orderCardActionCreator = () => dispatch => {
dispatch(orderCardAction());
// get the data from the API call here and dispatch another action with the response payload
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment