Ajout domaine 'init' dans les sagas

This commit is contained in:
2020-02-25 14:35:47 +01:00
parent dbff21db9d
commit 60267305cb
4 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,8 @@
import { all } from 'redux-saga/effects';
import { checkSessionSaga } from './session.saga';
export function* rootSaga() {
yield all([
checkSessionSaga(),
]);
}

View File

@ -0,0 +1,11 @@
import { APIClient } from '../../services/api-client.service';
import { call } from 'redux-saga/effects';
export function* checkSessionSaga() {
const client = new APIClient();
try {
yield call(client.retrieveSessionUser);
} catch(err) {
console.error(err);
}
}

View File

@ -1,9 +1,11 @@
import { all } from 'redux-saga/effects';
import { rootSaga as authRootSaga } from './auth/root.saga';
import { rootSaga as failureRootSaga } from './failure/root.saga';
import { rootSaga as initRootSaga } from './init/root.saga';
export default function* rootSaga() {
yield all([
initRootSaga(),
authRootSaga(),
failureRootSaga(),
]);