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