Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function* login({ payload }) {
- try {
- // from API.post I want to be able to dispatch an action that I will handle in a different saga.
- const resp = yield call(API.post, 'api/1/login', {
- email: payload.email,
- password: payload.password,
- });
- yield put(AuthActions.loginSuccess(resp.token));
- } catch (error) {
- yield put(AuthActions.loginError(error));
- }
- }
Add Comment
Please, Sign In to add comment