雷杜。如何在sagaMiddleWare中运行多个sagas。使用redux saga运行([f1*()、f2*()、f3*()])?
我需要在不同的时间点开始几个传奇故事的解决方案。我已经创建了3个不同的传奇,并尝试将它们像数组一样实现到雷杜。如何在sagaMiddleWare中运行多个sagas。使用redux saga运行([f1*()、f2*()、f3*()])?,redux,react-redux,redux-saga,Redux,React Redux,Redux Saga,我需要在不同的时间点开始几个传奇故事的解决方案。我已经创建了3个不同的传奇,并尝试将它们像数组一样实现到sagaMiddleWare.run()。但现在我得到一个错误-runSaga(storeInterface,saga,…args):saga参数必须是一个生成器函数 我知道为什么会发生这种错误,但不知道如何解决它 谢谢大家! sagaMiddleWare.run([watchSearchForCash, watchBootlegging, watchGraffiti]) 通过将所有传奇合并
sagaMiddleWare.run()
。但现在我得到一个错误-runSaga(storeInterface,saga,…args):saga参数必须是一个生成器函数代码>
我知道为什么会发生这种错误,但不知道如何解决它
谢谢大家!
sagaMiddleWare.run([watchSearchForCash, watchBootlegging, watchGraffiti])
通过将所有传奇合并到一个包装中,您可以轻松地实现它,例如称为rootSaga
:
function * rootSaga() {
yield [
watchSearchForCash,
watchBootlegging,
watchGraffiti
]
}
然后在sagaMiddleWare.run(rootSaga)
That’s all magic:)您可以通过将所有传奇合并到一个包装中(例如)名为rootSaga来轻松实现:
function * rootSaga() {
yield [
watchSearchForCash,
watchBootlegging,
watchGraffiti
]
}
然后在sagaMiddleWare.run(rootSaga)
That’s all magic:)收益率[…效果]遭到否决。使用指定的全部收益率([watchSearchForCash,Watch盗录,watchGraffiti])。别忘了从“redux saga/effects”导入{all};收益率[…效果]已被弃用。使用指定的全部收益率([watchSearchForCash,Watch盗录,watchGraffiti])。别忘了从“redux saga/effects”导入{all};