%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.8352c036a19b0051d0217d27d25e3f4a/static/js/sagas/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.8352c036a19b0051d0217d27d25e3f4a/static/js/sagas/logOut.js |
import { put, call, takeEvery } from "redux-saga/effects"; import LIST_ACTIONS from "constants/action_types"; import { deleteDataAction } from "common/actions"; import configFunc from "config/config"; const config = configFunc(); function* runLogOut() { try { yield call(deleteDataAction(`${config.apiUrl}logout`, null, true)); yield put({ type: LIST_ACTIONS.LOGOUT_SUCCESS, }); } catch (e) { yield put({ type: LIST_ACTIONS.LOGOUT_ERROR, e, }); } } export default function* logOut(dispatch) { yield takeEvery(LIST_ACTIONS.LOGOUT_REQUEST, runLogOut, dispatch); }