You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a lots of dispatch overlap issues.
My basic scenario is :
When the the project is initialized,
1- it loads the current user (if the client has a token) (it dispatches LOAD_USER, LOAD_USER_SUCCESS, LOAD_USER_ERROR)
2- The user store listens to LOAD_USER_SUCCESS, sets the user and emits a users.load_user.success
3- My App component listens to users.load_user.success and calls the action to initialize the router.
4- The router dispatches CHANGE_ROUTE, CHANGE_ROUTE_SUCCESS and CHANGE_ROUTE_ERROR
The problem is the dispatcher did not finish to dispatch LOAD_USER_SUCCESS and triggers CHANGE_ROUTE.
You never really talked about implementing a queue of dispatch, is there a reason for that ?
ps. I saw someone proposed to implement the possibility to $listenTo multiple events, what is the status ?
The text was updated successfully, but these errors were encountered:
This is a typical FLUX issue. There has been a lot of progress on FLUX and if you take a look at: www.christianalfoni.com/cerebral you can check out my latest project which handles all this stuff a lot better. It also gives some pretty amazing possibilities with the debugger.
So FLUX works very well, it has solved a lot of issues, but it has also introduced some new, like what you are experiencing here. So yeah, the community is moving a long and introducing suggestions to fixing these issues.
As @christianalfoni said this is a problem that is generic to the flux architecture. The primary way I have seen it solved is by having an action dispatch multiple events, e.g.:
The basic idea being that your actions are the place where you chain multiple actions together. The listeners are always only for syncing data from stores to the view.
Hi,
I'm facing a lots of dispatch overlap issues.
My basic scenario is :
When the the project is initialized,
1- it loads the current user (if the client has a token) (it dispatches LOAD_USER, LOAD_USER_SUCCESS, LOAD_USER_ERROR)
2- The user store listens to LOAD_USER_SUCCESS, sets the user and emits a users.load_user.success
3- My App component listens to users.load_user.success and calls the action to initialize the router.
4- The router dispatches CHANGE_ROUTE, CHANGE_ROUTE_SUCCESS and CHANGE_ROUTE_ERROR
The problem is the dispatcher did not finish to dispatch LOAD_USER_SUCCESS and triggers CHANGE_ROUTE.
You never really talked about implementing a queue of dispatch, is there a reason for that ?
ps. I saw someone proposed to implement the possibility to $listenTo multiple events, what is the status ?
The text was updated successfully, but these errors were encountered: