-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
getState for all action creators #180
Comments
Or we can rewrite promise middleware like this:
and action will look something like this:
|
This was referenced Sep 23, 2020
This was referenced Sep 26, 2022
This was referenced Oct 7, 2022
This was referenced Oct 8, 2022
This was referenced Oct 9, 2022
This was referenced Oct 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So suppose we create dispatcher with promise middleware:
and we have some action:
but in this action I want to check local state on presence this todo item to eliminate request, like this:
The problem that I have no access to
getState
function.One of the solutions is to pass to
bindActionCreators
optional argumentgetState
function:so all actions can get state if they need it.
@gaearon @acdlite
The text was updated successfully, but these errors were encountered: