-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
access to the store #336
Comments
Bingo. Thats probably the reason. |
@trueter got it right, Redux by its nature embraces functional programming, unit testing becomes much more complicated when dependencies increases, by definition, Redux action creators are pure functions that should just return the action payload and shell be independent. |
ok thx. But I am wondering because in this great tutorial it tends more to the other version (with the properties from the store instead of the params) : http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html ... |
also in the redux migration docs it sais: ... which also leads to the other version (with the properties from the store instead of the params) |
Hey,
I would like to access the store and it's state inside the async actions (https://rackt.github.io/redux/docs/advanced/AsyncActions.html).
The logic for the params of the server calls are quite complicated for me and need to be calculated with several state properties of the one central store.
Is it better to pass every state property to the async-action or to let this async-actionCreator pull every property from the store by itself?
Here are the differences to make my point clear:
with multiple params and without the store:
with the properties from the store instead of the params :
The question is now: Why is the store not globally accessible in this project? If it isn't modified (wrote to) without proper actions and just read everywhere then this seems ok to me. On the other hand the async-actionCreator would not be a pure function anymore because it's then dependent on the state in the store.
The text was updated successfully, but these errors were encountered: