-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support saga effects put.resolve(action) #1038
Conversation
|
我觉得应该可以支持注入 effects #886 (comment) #886 (comment) 当然现在也可以直接传入自定义的 effects,但是配合 namespace 的时候不灵活 |
你是要实现 put 的同步执行吗? 但 put.resolve 解决的是 Promise action 的问题,put.resolve 另一个 model 的 effect,并不会等那个 effect 执行完之后再执行下一步的。 |
@sorrycc 对,是想实现同步执行。 本来以为 而用 但我现在又开始觉得用 |
可以试试 put + take 的组合:
|
put + take 的组合也是一种可行的方案,但不够健壮,比如 effects: {
* doSth ({ payload }, { put, take }) {
yield put({ type: 'addDelay', payload: { amount: 2 } })
yield take('addDelay/@@end')
}
} 如果短时间内大量调用 |
先关了, |
No description provided.