I'm trying very simple example from redux-saga page.
function* saga(): SagaIterator {
yield takeEvery(T.GET_CREDENTIALS, getCredentials);
}
export default function* rootSaga() {
yield all([
saga(),
]);
}
But I get typescript error:
Argument of type 'IterableIterator<RootEffect | TakeEffect |
ChannelTakeEffect<any> | PutEffect<any> | ChannelPutEf...' is not
assignable to parameter of type '{ [key: string]: Effect; }'.
Index signature is missing in type 'IterableIterator<RootEffect |
TakeEffect | ChannelTakeEffect<any> | PutEffect<any> |
ChannelPutEf...'.
What I'm doing wrong? Thanks for help
Since links to solutions apparently get downvoted, this is the solution:
export default function* rootSaga() {
yield all([
call(saga()),
]);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With