UNPKG

ih-black-lion

Version:

State handler for Arus projects

16 lines (13 loc) 592 B
import { takeEvery, put, call } from 'redux-saga/effects'; import { REQUEST_ACADEMICPROFILE, RECEIVE_ACADEMICPROFILE } from '../actionTypes'; export function* fetchAcademicProfile(action) { try { const response = yield call(action.Api.getAcademicProfile, action.requestParams); yield put({ type: RECEIVE_ACADEMICPROFILE, response, status: 'success' }); } catch (error) { yield put({ type: RECEIVE_ACADEMICPROFILE, response: error, status: 'error' }); } } export default function* AcademicProfileSaga() { yield takeEvery(REQUEST_ACADEMICPROFILE, fetchAcademicProfile); }