Skip to content

Instantly share code, notes, and snippets.

@mvbattan
Created November 28, 2018 20:31
Show Gist options
  • Save mvbattan/bd70b16c9439f6e92215a614495e4d62 to your computer and use it in GitHub Desktop.
Save mvbattan/bd70b16c9439f6e92215a614495e4d62 to your computer and use it in GitHub Desktop.
using fetchMiddleware
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