Skip to content

Instantly share code, notes, and snippets.

@mvbattan
Created December 11, 2017 17:28
Show Gist options
  • Save mvbattan/900a7c79b38ba6ce039c42e8600bfcd3 to your computer and use it in GitHub Desktop.
Save mvbattan/900a7c79b38ba6ce039c42e8600bfcd3 to your computer and use it in GitHub Desktop.
Targeted actions
const privateActionCreators = {
getMatchesSuccess: matchList => ({
type: actions.GET_MATCHES_SUCCESS,
payload: matchList,
target: 'matches'
}),
getMatchesError: error => ({
type: actions.GET_MATCHES_ERROR,
payload: error,
target: 'matches'
}),
getPitchesSuccess: pitchList => ({
type: actions.GET_PITCHES_SUCCESS,
payload: pitchList,
target: 'pitches'
}),
getPitchesFailure: error => ({
type: actions.GET_PITCHES_FAILURE,
payload: error,
target: 'pitches'
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment