takeLatest issue
See original GitHub issueWhen I run this simple code
function* fetchUser() {
yield 1;
}
function* watchLastFetchUser() {
yield* takeLatest('USER_REQUESTED', fetchUser);
}
export default function* root() {
yield [
fork(watchLastFetchUser)
];
}
I get
redux-saga error: uncaught
at root
at watchLastFetchUser
TypeError: Cannot read property 'done' of undefined
I’m using saga’s done() method for server rendering. Simple sagas, that yield simple effects work fine. Simple implementation of takeLatest (like in docs) also works.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
takeLatest in effect not working · Issue #769 · redux-saga ...
I dipatch the action from componentDidMount. The takeLatest function is triggering as many requests as I mount the component, and is not ...
Read more >API Reference - Redux-Saga
And if this action matches pattern , takeLatest starts a new saga task in ... You can check inside the finally block if...
Read more >Redux Saga Error: takeLatest$1 requires a pattern or channel
Well, for me my action type was undefined, I changed the original file where I defined the types and forgot to effect the...
Read more >6 Handling complex side effects - Redux in Action
Your application may need to verify login credentials, issue an authorization token, ... import { call, put, takeLatest } from 'redux-saga/effects'; ...
Read more >How to use the redux-saga.takeEvery function in redux-saga
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can get around this by implementing
return
in iterators returned by saga helpers. Already pushed a fix with this solution. I did the tests locally on the @smashercosmo fork and the error is gone (although there are still an error related toimport
statements but that’s related to missing node presets)erg, this is a nasty one. A release would be great, especially since we can’t just depend on the github version w/o building the release ourselves.