Guest User

Untitled

a guest
Jun 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. export function* login({ payload }) {
  2. try {
  3. // from API.post I want to be able to dispatch an action that I will handle in a different saga.
  4. const resp = yield call(API.post, 'api/1/login', {
  5. email: payload.email,
  6. password: payload.password,
  7. });
  8. yield put(AuthActions.loginSuccess(resp.token));
  9. } catch (error) {
  10. yield put(AuthActions.loginError(error));
  11. }
  12. }
Add Comment
Please, Sign In to add comment