-
Notifications
You must be signed in to change notification settings - Fork 219
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
async TypedMiddleware? #96
Comments
Hey there -- sorry, thought I'd put in an answer to that Q! Could you describe the use-case a bit more to see if we can find a good solution? Overall, I definitely understand why this would be helpful, but this would essentially break the fundamental promise that Redux gives you: Actions are dispatched and reduced synchronously. This means you can do |
I see. I was thinking about what if you have to execute an async operation within middleware, such as if you want to persist the current state and the persistence method is asynchronous? Or perhaps you need some other async method to proceed? Isn't this something that middleware should support? Or not? |
It certainly is! The main trick: You can't use That said, if you'd like to use |
Basically calling async methods without waiting, I guess it makes sense. |
It'd be nice to have async versions of TypedMiddleware.
So the next dispatcher can be awaited.
Does that make sense?
The text was updated successfully, but these errors were encountered: