-
Notifications
You must be signed in to change notification settings - Fork 513
"...because actions have access to app state." #698
Comments
Yes. You can get state from Store via getState() function
|
Awesome, there are several examples in the project, thanks for humouring me. |
Actually, with the
This is pretty similar to the way |
@AugustinLF actually i believe you should only read from state, not do stuff with state as you say in comment, for doing stuff you should dispatch action. Only little problem with this injectDependencies I can see is in my opinion it's too late in middleware to check if something is loaded and stoping the action |
Yes of course. When I was saying "do something with", it was "read some value in it". Because anyway, event if you do change values, If you use ImmutableJS, it won't do anything. Yes it's true that its a bit late to prevent from firing an action, but if you want to do a check before calling your action creator, I think you'd be better off with this part of the state in the component, and simply do the check on the components props. |
In the README there's a quote "And remember, we have to pass only data going to be rendered, because actions have access to app state." I saw that you have set up actions to benefit from DI, but does that mean you can inject state?
The text was updated successfully, but these errors were encountered: