-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Have any good way to implement multi promise control like Async? #1070
Comments
It is not a Redux thing. You can do it with native promise example 1
example 2
then you can wrap it code in action using https://github.com/gaearon/redux-thunk or https://github.com/acdlite/redux-promise and it will work Look at the docs on MDN if you want more information |
@just-boris thx! I will try it~ |
Also, for combining async actions you can use redux-combine-actions. |
Yes, we suggest using middleware like redux-thunk or redux-promise for this. You can then use |
example1, I have 3 apis need to call, if they all resolve, return success and get me all data which return by those apis. If one of them are rejected, return failure to me.
example2, I have 2 apis need to call, if one of them resolve, return success and get me data.
If all of them are rejected, return failure to me.
Have any possible do such like these sophisticated async control on redux?
I have already used apiMiddleware, but it only use on 1 ajax call..
The text was updated successfully, but these errors were encountered: