In my understanding, asynchronous actions that rely on Ajax, etc. shouldn't block the action from being dispatched to all subscribers.
You'll have a separate action for the user action, like TODO_UPDATE_TEXT
in the TodoMVC example and one that gets called when the server returns, something like TODO_UPDATE_TEXT_COMPLETED
(or maybe just something more generic like TODO_UPDATE_COMPLETED
that contains a new copy of the latest attributes).
In cases where you want to do optimistic updates to show the user the effects of their change immediately, you can update the store in response to the user action immediately (and then once again when the server returns with the authoritative data). If you want to wait on the server, you can have the store only update itself in response to the server-triggered actions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…