-
-
Notifications
You must be signed in to change notification settings - Fork 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
How to dispatch more actions in 1 yield via PUT #459
Comments
If you want to dispatch 2 actions in 1 yield, you can just use redux-batched-actions package. |
you can yield an array of effects |
This post ranks high in google for this question, so thought I'd mention the above is deprecated and that you now want to do:
|
@kyle-ssg is there any technical difference between 2x |
@preciselywilliam @ronayumik if you haven't seen it yet, in the docs for SagaEffects.all() they compare it to a close representation of Promise's all(), which returns a single promise once all the promises passed to it are resolved. |
@kyle-ssg Great answer! But does this properly batch the two actions into a single subscription event? Making redux-batch redundant in this scenario. |
No. Even |
Ok, but https://github.com/manaflair/redux-batch/blob/master/README.md says that ” Note: Since this package got written, redux-saga improved and using all([ put(...), put(...) ]) seems to properly batch the two actions into a single subscription event, making redux-batch redundant in this scenario.” So should one use redux-batch with yield all([put(...),put(...)]) or it will not do batching? Or do I misunderstand something? I.e do I need to use redux-batch in configeStore.js or is simply using yield.all(put,put) enough?
…
@kyle-ssg Great answer! But does this properly batch the two actions into a single subscription event? Making redux-batch redundant in this scenario.
No. Even batch from Redux doesn't do that. It merely batches renders, not subscribers
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I just try and it work perfectly fine |
Why is
redux-saga
not dispatching action when used in this form:But it works in this manner:
I would like to dispatch 2 actions in 1
yield
thats why I am trying to use the arrow function(() => {})
.The text was updated successfully, but these errors were encountered: