redux-saga: takeLatest in effect not working
I have a project with a previous version where i access takeLatest from ‘redux-sga’, but after update the package, i get a warning that it has been deprecated. And when i import takeLatest from ‘redux-saga/effects’ the function is not working, it is not launching the effect qhen the action is dispatched
export function* loadUser() {
const endpoint = '/users/current';
console.log(endpoint)
const response = yield call(Api.request, endpoint, 'GET');
if (!response.errors) {
yield put(loadUserSuccess(response));
} else {
yield put(loadUserFail(response.message));
yield call(logout);
}
}
...
export function* loadUserWatcher() {
yield* takeLatest(LOAD_USER, loadUser);
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (7 by maintainers)
Wasnt the deprecation warning telling that you should use yield and not yield* from now on? Cant check the source code right now, but this should be the answer for your problem On Mon, 16 Jan 2017 at 18:12, Jose Miguel Navarro notifications@github.com wrote: