Created
December 11, 2017 18:02
-
-
Save mvbattan/aac3d7197c4a1cc3447175433ccf5558 to your computer and use it in GitHub Desktop.
Create Thunk Action
This file contains hidden or 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
import SoccerService from '../services/SoccerService'; | |
export const actions = createTypes(completeTypes['GET_MATCHES','GET_PITCHES'], '@SOCCER'); | |
const actionCreators = { | |
getMatches: () => | |
createThunkAction(actions.GET_MATCHES, 'matches', SoccerService.getMatches), | |
getPitches: clubId => | |
createThunkAction(actions.GET_PITCHES, 'pitches', SoccerService.getPitches, () => clubId) | |
}; | |
export default actionCreators; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment