Skip to content

Instantly share code, notes, and snippets.

@brownsmith
Last active March 18, 2020 11:00
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 brownsmith/c921259b7d4fe6c1b6988b119cb07138 to your computer and use it in GitHub Desktop.
Save brownsmith/c921259b7d4fe6c1b6988b119cb07138 to your computer and use it in GitHub Desktop.
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