Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

redux thunk user login example

const logInUser = creds => dispatch => {
  return axios.post('/login', creds).then(res => {
    const loggedInAction = { type: USER_LOGGED_IN, payload: res.data.user }
    dispatch(loggedInAction);
  });
}
Source by lambdaschool.instructure.com #
 
PREVIOUS NEXT
Tagged: #redux #thunk #user #login
ADD COMMENT
Topic
Name
3+2 =