`yield* takeEvery` causing 'not a function' error
See original GitHub issueBasically more or less the same as the examples from the README. Using the following code:
import { CREATING_LIVE_SHARE } from '../actions/liveShare';
export function* createLiveShare({ server }) {
// ...
}
export function* watchLiveShare() {
yield* takeEvery(CREATING_LIVE_SHARE, createLiveShare);
}
import watchLiveShare from '../sagas/liveShare';
const sagaMiddleware = createSagaMiddleware(watchLiveShare);
const store = createStore(
// ...
applyMiddleware(sagaMiddleware)
);
The error I get is:
watchLiveShare: uncaught TypeError: (0 , _reduxSaga.takeEvery)(...)[(intermediate value)] is not a function
It works fine when I remove the *
character from the yield
statement, i.e. yield takeEvery(...);
. I am not quite clear what yield*
does compared to yield
and if it is required.
Just in case it’s relevant, I am using babel-preset-es2015-node5 in node, so generators are not being polyfilled.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Unable to get Redux put to work within generator function
I think you're yielding (pausing) the generator function without calling next on it. Saga has functionality for this.
Read more >API Reference - Redux-Saga
Each function below returns a plain JavaScript object and does not perform any execution. ... takeEvery is a high-level API built using take...
Read more >adobe/redux-saga-promise - npm.io
If the saga function throws an error, the promise will be rejected with that ... not implemented yet") } function * rootSaga ()...
Read more >Easiest way to test asynchronous redux sagas with jest
Let us create our helper function first which will fetch the list of movies. ... yield takeEvery('MOVIE_FETCH_REQUESTED', fetchMoviesSaga);
Read more >Testing side effects using redux saga - Instea
In sagasall side effects should be created using helper functions from ... yield put({type: 'FETCH_ARTICLE_FAILED', error}).
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
0.9.5
fixes this issue for me. Thanks!Oops! forgot to mention this in release notes. Thanks for the remainder