Last active
November 29, 2018 13:44
-
-
Save mvbattan/5b33ca7bcdfe6c2422b366b8bc1e535b to your computer and use it in GitHub Desktop.
createThunkAction with named params
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
import SoccerService from '../services/SoccerService'; | |
export const actions = createTypes(completeTypes['GET_MATCHES','GET_PITCHES'], '@SOCCER'); | |
const actionCreators = { | |
getMatches: () => createThunkAction({ | |
type: actions.GET_MATCHES, | |
target: 'matches', | |
service: SoccerService.getMatches | |
}), | |
getPitches: clubId => createThunkAction({ | |
type: actions.GET_PITCHES, | |
target: 'pitches', | |
service: SoccerService.getPitches, | |
payload: clubId | |
}) | |
}; | |
export default actionCreators; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment