Skip to content
Discussion options

You must be logged in to vote

Hey @superx3man!
This is different, because the first option makes the function "impure" in the functional sense.
It means that the overall state of the system may be different when passing the same state and action to the reducer. This is not really problematic nowadays because Effects are always run at some point, but we can imagine a kind of Try higher order reducer where it would perform the reduction and potentially discard/revert the changes if state ends up in some specific state. But in this case, the logging that you performed inline wouldn't be reverted and will appear in your logs, whereas the Effect will simply not be executed in the second case. This is hypothetical, and righ…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tgrapperon
Comment options

Answer selected by superx3man
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants