UNPKG

ih-black-lion

Version:

State handler for Arus projects

16 lines (13 loc) 583 B
import { takeEvery, put, call } from 'redux-saga/effects'; import { REQUEST_STUDENTACCOUNT, RECEIVE_STUDENTACCOUNT } from '../actionTypes'; export function* fetchStudentAccount(action) { try { const response = yield call(action.Api.getStudentAccount, action.requestParams); yield put({ type: RECEIVE_STUDENTACCOUNT, response, status: 'success' }); } catch (error) { yield put({ type: RECEIVE_STUDENTACCOUNT, response: error, status: 'error' }); } } export default function* StudentAccountSaga() { yield takeEvery(REQUEST_STUDENTACCOUNT, fetchStudentAccount); }