hivejs / hive

:rocket: A real-time collaboration platform :zap:
http://hivejs.org
Other
50 stars 6 forks source link

Refactor ui: More saga, less logic in action creators #99

Closed marcelklehr closed 8 years ago

marcelklehr commented 8 years ago
marcelklehr commented 8 years ago

Template for action types: category component/[object.]action e.g. trigger:submission chat/message.send

categories of actions:

When the user clicks on something, this will emit a trigger action. Sagas listen for triggers and emit effects, among which are evoke actions. These can in turn be listened on by other sagas, but, since reducers will typically only act on evocations, they usually produce a change in the UIs.

marcelklehr commented 8 years ago

Saga code should have as little to do with actions as possible. Actions should only be used to update state or signal events, not for invocations. Instead of putting failures, throw an error!