-
Notifications
You must be signed in to change notification settings - Fork 24
request in success? Why? #29
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
Comments
Thanks, @meandmax, and great question! I think this is a case of broad pattern, narrow example, and poor ("no") explanation from the author. The pattern: even though Definitely worth notes both here (#22) and in the supporting article, though. I'll add. |
Ah ok, got it ... so you would say its generally a good pattern to dispatch always both objects when doing an async api action call? Another question that I have in mind is what happens if you have several actions which needed to be called following a successful api call? Lets say you need to reset or initialise https://github.com/rjz/typescript-react-redux/blob/master/src/actions/index.ts#L66 Thought about redux-loop to isolate side-effects, but I have the feeling with you approach I don`t need an extra library, I just need to change my way of writing thunks. Thanks for your help. |
For now I added a third parameter to
Whats your thoughts on that? |
The best solution is the one that works! The original |
Im curious why you dispatch the request as a parameter in the success action group like here: https://github.com/rjz/typescript-react-redux/blob/master/src/actions/index.ts#L66
You do not use this property at all in the reducer, so is there another reason why you dispatch the request?
Nice work btw.
Thanks Max
The text was updated successfully, but these errors were encountered: