Replies: 1 comment
-
Thanks for pointing this out! I agree it's a rather large footgun. I do like message-based action though.. perhaps we give the user a dispatch instead of a snapshot? Not sure how much more useful it would be than other provided interfaces. Reducers are nice for organizing and structuring your mutations into predictable modules. Having access to an async context is definitely useful, however I do agree right now it may be doing more harm than good atm. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
while reading the book I saw that yewdux supports async reducers and I started wandering, is it free of race conditions? I wrote following code sample:
It shows 1 2 3, then let it be a network request for a 1 second that appends it with 10 20 30 and request that appends with 100 200 300. As you can see, it shows:
1 2 3
1 2 3 10 20 30
1 2 3 100 200 300
I don't think that this is a bug or a problem, we could just use async functions that will dispatch sync reducers but the question is what is the purpose of async reducers? I can't come up with any use case - any way it will capture the state that it had on the moment of calling and discard everything done to the store after that point when resolved.
Beta Was this translation helpful? Give feedback.
All reactions