Skip to content

Instantly share code, notes, and snippets.

@kwhitaker
Created September 12, 2015 16:21
Show Gist options
  • Save kwhitaker/658681445e762699c698 to your computer and use it in GitHub Desktop.
Save kwhitaker/658681445e762699c698 to your computer and use it in GitHub Desktop.
export function createCharacter(char) {
return dispatch => {
dispatch(submitCharacter(char));
return request.post('/new-character')
.send(JSON.stringify(char))
.then((response) => {
dispatch(routeToNewCharacter(response.body.id));
}, (error) => {
dispatch(receiveCharError(error.message));
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment