src/containers/signup/sagas.js
// Action is found by the watcher
Action is found by the watcher
Action is found by the watcher
function* signupFlow(action) {
    try {
        const {email, password} = action;
        const response = yield call(signupApi, email, password);
        yield put({type: SIGNUP_SUCCESS, response})
    } catch (error) {
        yield put({type: SIGNUP_ERROR, error})
    }
}
function * signupFlow ( action ) { try { const { email , password } = action ; const response = yield call ( signupApi , email , password ) ; yield put ( { type : SIGNUP_SUCCESS , response } ) } catch ( error ) { yield put ( { type : SIGNUP_ERROR , error } ) } }
Action is found by the watcher
Action is found by the watcher
// pulls "calls" to our signupApi with our email and password // from our dispatched signup action, and will PAUSE // here until the API async function, is complete! // when the above api call has completed it will "put", // or dispatch, an action of type SIGNUP_SUCCESS with // the successful response. // if the api call fails, it will "put" the SIGNUP_ERROR // into the dispatch along with the error.