Closed tdawes closed 4 years ago
In what case were you awaiting multiple dispatches?
The watchForComplete
check in the store was only there for testing and was never intended to be used in production. We never expected/wanted users of the framework to be awaiting actions (because of how the store updates).
This wasn't a problem in production. I was triggering actions from an input
's onChange
callback, and as part of debugging another problem, I wanted to check that there weren't a large number of unresolved promises floating around (essentially a memory leak)
ah I see. In that case, then this looks good 👍
Without this, dispatching a second action while awaiting the result of a first action would cause the first dispatch call to never resolve, since we were using a singleton on the store. This updates it so that neither dispatch call will resolve until the both are done.
Not sure if this is the best approach - thoughts?