import { APIClient } from '../../services/api-client.service'; import { call, put } from 'redux-saga/effects'; import { refreshUserSessionFailure, refreshUserSessionSuccess } from '../../actions/auth.actions'; export function* refreshSessionSaga() { const client = new APIClient(); let user; try { user = yield call(client.retrieveSessionUser); } catch(err) { yield put(refreshUserSessionFailure(err)); } yield put(refreshUserSessionSuccess(user)); }