Reaction - Authentication Process: Unable to send message in the middle of sending

I started playing with reaction via flummox, reaction bootstrap and react router. I am trying to create a basic isomorphic CMS for my sites.

Context:

In terms of authentication, each user has a list of features, and each component uses my β€œcan” repository method to authenticate or not, etc.

I have a custom navigation bar at the top, visible on every page processed by reat-router, with a signin / out button, which basically displays on the Modal click with the signin form if the user has not registered a logout confirmation yet.

When a user logs in, I want updated components to be displayed on the updated page (for logging out).

Here is an example with a page that displays a list that can only be viewed by an authenticated user with the appropriate rights:

Process:

  • When a user submits a form, I invoke an action
  • The action sends a request to the server
  • The action is registered by the authentication store, which updates its currentUser
  • The component has currentUser support and uses componentWillReceiveProps to check if this alert has changed and trigger an action to request a list
  • the action is recorded by the store, updating its elements.

Problem: Unable to send message in the middle of sending

Hack: The second action is placed in setTimeout

Questions: I read a lot of answers about this particular problem, and they say that it is a bad design to trigger two actions during the same dispatcher cycle. So my question is: is there a better way to develop this process?

PS: If necessary, I can publish the code.

+4
reactjs react-router react-bootstrap flux flummox
source share

No one has answered this question yet.

See similar questions:

7
React Flux - dispatch within dispatch - how to avoid this?

or similar:

1203
Move programmatically using a responsive router
1094
Loop inside React JSX
567
Why do we need middleware for async thread in Redux?
fifty
Performing Redux Actions in Response to Routing in React Router
7
React Flux - dispatch within dispatch - how to avoid this?
6
React setState () does not update state after request $ .ajax ()
5
responsive / threaded-child components of the user - everything should be directed through the dispatcher
3
React, React Router and Flux: "sending in the middle of sending" when I try to clear messages from the repository
0
Call the action after the callback from the listener and ... cannot be sent in the middle of sending?
0
respond to a natural discount on sending an external component is not a component of triggerWillReceiveProps

All Articles