Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function* updateSomethingFlow(action) {
- try {
- const response = yield call(updateSomething, action.payload);
- if (response) {
- yield put({
- type: UPDATE_SUCCESS
- });
- }
- } catch (err) {
- yield put({
- type: UPDATE_FAILURE,
- payload: prepareErrorMessages(err, 'Failed to update. Please, try again.')
- });
- }
- }
- case UPDATE_FAILURE:
- nextState = {
- ...state,
- loading: false,
- errors: prepareErrorMessages(payload, 'Failed to update. Please, try again.'),
- };
- break;
Add Comment
Please, Sign In to add comment