Add an optional 'callback' to dispatch#1096
Conversation
|
If you want to get this working, you should pass callback through all store decorations in compose method. |
|
I don't think we want to get this in. I don't know what a better solution would look like but it shouldn't involve Redux. |
|
@gaearon as far as I can tell there is no way to use redux for this use case then. Why is having a callback for when a dispatch is 'complete' outside of the scope of Redux? |
|
Because |
|
Thanks for the explanation. I think I see a path forward by adding a decorator outside of @connect and overriding the listener trigger in Connect. |
Called when all listeners have resolved.
This enables a dispatch caller to run a callback once all changes from an action have been flushed and rendered (in my case to the DOM via React).
I didn't include a promise implementation here since I don't know what people's preferences are.
Thoughts about this? I have a specific use case around DOM selection binding that this enables.
See reduxjs/react-redux#208 for related change to react-redux.