18 lines
557 B
TypeScript
18 lines
557 B
TypeScript
import { all, takeEvery, takeLatest } from 'redux-saga/effects';
|
|
import { failuresSaga } from './failure';
|
|
import { LOGOUT_REQUEST, LOGOUT_SUCCESS } from '../actions/logout';
|
|
import { logoutSaga, logoutSuccessSaga } from './logout';
|
|
|
|
export function* rootSaga() {
|
|
yield all([
|
|
takeEvery(patternFromRegExp(/^.*_FAILURE/), failuresSaga),
|
|
takeLatest(LOGOUT_REQUEST, logoutSaga),
|
|
takeLatest(LOGOUT_SUCCESS, logoutSuccessSaga)
|
|
]);
|
|
}
|
|
|
|
export function patternFromRegExp(re: any) {
|
|
return (action: any) => {
|
|
return re.test(action.type);
|
|
};
|
|
} |