mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-25 11:13:41 +00:00
Introduce action creators
These can be used to dispatch actions immediately, or after some asynchronous work has been done. Also, create GroupActions.fetchJoinedGroups as an example. The concept of async action creators can be used in the following cases: - stores or views that do async work, dispatching based on the results - actions that have complicated payloads, would make more sense as functions with documentation that dispatch created actions.
This commit is contained in:
@@ -52,10 +52,10 @@ class TagOrderStore extends Store {
|
||||
this._setState({orderedTags});
|
||||
}
|
||||
break;
|
||||
// Initialise the state such that if account data is unset, default to the existing ordering
|
||||
case 'all_tags':
|
||||
// Initialise the state such that if account data is unset, default to joined groups
|
||||
case 'GroupActions.fetchJoinedGroups.success':
|
||||
this._setState({
|
||||
allTags: payload.tags.sort(), // Sort lexically
|
||||
allTags: payload.result.groups.sort(), // Sort lexically
|
||||
});
|
||||
break;
|
||||
// Puts payload.tag at payload.targetTag, placing the targetTag before or after the tag
|
||||
|
||||
Reference in New Issue
Block a user