You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I only took a quick glance, but I would make a few suggestions with regards to conventions/syntax.
For thunks, IMO it's best to have a pattern like this:
Thunk: USER_REQUEST_[action name]
Succeed: USER_[action name]SUCCEEDED
Failed: USER[action name]_FAILED
Also, I might have missed something (likely, since I didn't look in detail), but I'm not sure why you're using thunks this way:
What had led me to the shopping cart example in the first place was the need to access the state in my actions and so i needed the getState property. I think I thought that I had to format my thunks like that to get it, but that may not be the case.
The text was updated successfully, but these errors were encountered:
As per meteor/guide#263 (comment), @ffxsam said:
He gives a great explanation and example of how to do thunks here:
https://github.com/ffxsam/ffx-meteor-react-boilerplate/blob/example/client/actions/colors.js
I had originally done the thunks like that following @gaearon's examples here https://github.com/reactjs/redux/blob/master/examples/shopping-cart/actions/index.js. He appears to be using that syntax despite not all of the code wrapped being async, I guess maybe he's doing that for consistency and to allow for async or additional stages later.
What had led me to the shopping cart example in the first place was the need to access the state in my actions and so i needed the getState property. I think I thought that I had to format my thunks like that to get it, but that may not be the case.
The text was updated successfully, but these errors were encountered: