Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created November 5, 2015 07:46
Show Gist options
  • Save lesniakania/daefff92eadecde22801 to your computer and use it in GitHub Desktop.
Save lesniakania/daefff92eadecde22801 to your computer and use it in GitHub Desktop.
const _requestSubmission = (id) => {
return {
type: ActionTypes.REQUEST_SUBMISSION,
id: id
};
}
const _receiveSubmission = (submission) => {
return {
type: ActionTypes.RECEIVE_SUBMISSION,
submission: submission
};
}
const _fetchSubmission = (id) => {
return (dispatch) => {
dispatch(_requestSubmission(id));
return Connection.get(`/submissions/${id}`)
.then((response) => {
dispatch(_receiveSubmission(response.data))
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment