Flux Dispatch.dispatch(...): Cannot Dispatch In The Middle Of A Dispatch
So when I get sign-in success callback I want to make redirect,
redirect works through dispatcher too.
And I am getting Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.
Is there any hack to call action in the middle ?
I don't see where in the gist that you posted you are doing the redirect. I only see the AUTH_SIGNIN and AUTH_SIGNIN_SUCCESS actions, and they look pretty straightforward.
But no, there is no hack to create an action in the middle of a dispatch, and this is by design. Actions are not supposed to be things that cause a change. They are supposed to be like a newspaper that informs the application of a change in the outside world, and then the application responds to that news. The stores cause changes in themselves. Actions just inform them.
If you have this error, then you need to back up and look at how you're handling the original action. Most often, you can set up your application to respond to the original action, accomplish everything you need to do, and avoid trying to create a second action.
- → React + Flux - How to avoid global variable
- → Alt @decorators in React-Native
- → Include JointJS diagram in React/Flux projects
- → What is causing the web page to reload?
- → Analysis of Flux implementations
- → How to handle global state data into deeply nested components in Redux?
- → Redux: Using async middlewares vs dispatching actions on success functions
- → Multiple Components Using One Store
- → How to enforce data constraints in redux
- → ReactJs + Reflux // trigger is executed on null component?
- → Best Practice: Handle read-only data with Redux
- → Do Flux (by Facebook) handle server side update with sockets
- → update reactjs context after ajax request finished with flux architecture