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
can redux saga dispatch return result immediately instead of returning action #1907
Comments
You don't call saga directly, you actually call |
I know it. |
Then what is your question about ? You can use something like https://github.com/Chion82/redux-wait-for-action this in order to achieve this behavior but you should not build your app in that way. |
Hey @alanhg I needed the same behavior once so I wrote my own helper functions to do that. It also enables waiting for the result of dispatched actions in saga. Take a look at redux-saga-callback. |
@kutlugsahin I will try. |
Hello @alanhg , Did you got any solution for this, if yes Can you please update? |
@nilu1991 I found a solution,@adobe/redux-saga-promise and I create demo, you can read my commit |
maybe like this
benefit
I can use the effect's result directly, don't need to put action and save data to redux store.
dva.js
According to my understanding, dva.js is based on the framework of redux-saga and other technologies. When we dispatch the action in this framework and execute saga-effects, we can get the result directly. I think this is a very good feature.
about the question
https://stackoverflow.com/questions/52214499/can-redux-saga-dispatch-return-api-result-immediately-instead-of-returning-actio
The text was updated successfully, but these errors were encountered: