We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
` yield put({ type: 'updateState', payload: {data}, }); yield take('updateState/@@end');`
正常执行
程序卡在yield take(),没有异常抛出。updateState正常执行完成。
2.0.3
The text was updated successfully, but these errors were encountered:
sorrycc/blog#48的描述,reducer应该是不会触发这个action。 那么问题又来了,有foo和bar两个effect,foo需要bar返回的数据,应该用何种方式获取? yield put({type: 'bar'}); yield take('bar/@@end'); const data = yield select(_ => _.data); 这里并不能获取到bar的结果。
yield put({type: 'bar'}); yield take('bar/@@end'); const data = yield select(_ => _.data);
Sorry, something went wrong.
@Kroderia hi
effect 前后会额外触发 /@@start 和 /@@EnD 的 action,可利用此约定实现 put 的同步执行
1 你的put操作必须是一个effect才能触发到这个effect的/@@start|end的take 2 第二个问题,两个effect,一个依赖另外一个的结果,能否在一个effect.then里再dispatch第二个effect? 如果一定要在effect中堵塞调用第二个effect可以用利用take@@end的机制来实现 参考这个 issues/1212
effect
/@@start|end
take
effect.then
dispatch
take@@end
No branches or pull requests
Code to reproduce the issue: (请提供可复现的代码或者步骤)
Expected behavior: (预期的正常效果)
正常执行
Actual behavior: (实际效果)
程序卡在yield take(),没有异常抛出。updateState正常执行完成。
Versions of packages used: (哪个库的哪个版本出现的问题)
2.0.3
The text was updated successfully, but these errors were encountered: