Skip to content

Instantly share code, notes, and snippets.

@SeanRoberts
Created August 1, 2017 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanRoberts/e2a33e586e027d0144e85a34319f451b to your computer and use it in GitHub Desktop.
Save SeanRoberts/e2a33e586e027d0144e85a34319f451b to your computer and use it in GitHub Desktop.
export const doLogin = (email, password) => {
return (dispatch) => {
dispatch({ type: START_LOGIN });
fetch(myLoginUrl, { email, password })
.then(() => dispatch({ type: LOGIN_SUCCESS }))
.catch((err) => dispatch({ type: LOGIN_FAILURE, err: err }))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment