Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as api from 'api';
- import {loginRequest, loginSuccess, loginFailure} from "./loginActions';
- export const loginThunk =
- (name: string, password: string)=>
- (dispatch: Function)=>{
- dispatch(loginRequest());
- try{
- api.login(name, passwrod);
- }
- catch(err){
- dispatch(loginFailure(err));
- return;
- }
- dispatch(loginSuccess();)
- };
Add Comment
Please, Sign In to add comment