Created
November 5, 2015 07:46
-
-
Save lesniakania/daefff92eadecde22801 to your computer and use it in GitHub Desktop.
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
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