Guest User

Untitled

a guest
Feb 17th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import * as api from 'api';
  2. import {loginRequest, loginSuccess, loginFailure} from "./loginActions';
  3.  
  4. export const loginThunk =
  5. (name: string, password: string)=>
  6. (dispatch: Function)=>{
  7. dispatch(loginRequest());
  8. try{
  9. api.login(name, passwrod);
  10. }
  11. catch(err){
  12. dispatch(loginFailure(err));
  13. return;
  14. }
  15. dispatch(loginSuccess();)
  16. };
Add Comment
Please, Sign In to add comment