Created
November 28, 2018 20:31
-
-
Save mvbattan/bd70b16c9439f6e92215a614495e4d62 to your computer and use it in GitHub Desktop.
using fetchMiddleware
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: () => ({ | |
type: actions.GET_MATCHES, | |
target: 'matches', | |
service: SoccerService.getMatches | |
}), | |
getPitches: clubId => ({ | |
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