Files
planka/client/src/sagas/login/index.js

15 lines
426 B
JavaScript
Raw Normal View History

import { all, call, cancel, fork, take } from 'redux-saga/effects';
2019-08-31 04:07:25 +05:00
import watchers from './watchers';
2022-08-04 13:31:14 +02:00
import services from './services';
2019-08-31 04:07:25 +05:00
import ActionTypes from '../../constants/ActionTypes';
export default function* loginSaga() {
2020-03-25 00:15:47 +05:00
const watcherTasks = yield all(watchers.map((watcher) => fork(watcher)));
2019-08-31 04:07:25 +05:00
yield take(ActionTypes.AUTHENTICATE__SUCCESS);
2019-08-31 04:07:25 +05:00
yield cancel(watcherTasks);
2022-08-04 13:31:14 +02:00
yield call(services.goToRoot);
2019-08-31 04:07:25 +05:00
}