ref: Refactoring
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { all, takeEvery } from 'redux-saga/effects';
|
||||
|
||||
import { authenticateService, clearAuthenticateErrorService } from '../services';
|
||||
import services from '../services';
|
||||
import EntryActionTypes from '../../../constants/EntryActionTypes';
|
||||
|
||||
export default function* loginWatchers() {
|
||||
yield all([
|
||||
takeEvery(EntryActionTypes.AUTHENTICATE, ({ payload: { data } }) => authenticateService(data)),
|
||||
takeEvery(EntryActionTypes.AUTHENTICATE_ERROR_CLEAR, () => clearAuthenticateErrorService()),
|
||||
takeEvery(EntryActionTypes.AUTHENTICATE, ({ payload: { data } }) =>
|
||||
services.authenticate(data),
|
||||
),
|
||||
takeEvery(EntryActionTypes.AUTHENTICATE_ERROR_CLEAR, () => services.clearAuthenticateError()),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { takeEvery } from 'redux-saga/effects';
|
||||
import { LOCATION_CHANGE } from 'connected-react-router';
|
||||
|
||||
import { handleLocationChangeService } from '../services';
|
||||
import services from '../services';
|
||||
|
||||
export default function* routerWatchers() {
|
||||
yield takeEvery(LOCATION_CHANGE, () => handleLocationChangeService());
|
||||
yield takeEvery(LOCATION_CHANGE, () => services.handleLocationChange());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user