login-flow
login-flow copied to clipboard
Remove some responsibilities from action
Hi :)
I think that would be really nice if keep the handling errors in the component itself and remove it from the actions https://github.com/mxstbr/login-flow/blob/master/js/actions/AppActions.js#L195
I'm working on a PR for that, and what I'd like to propose is something like:
- Dispatch and action like 'invalid_login' or something. ( I'll think a better name )
- Subscribe to reducer and update the component based on the reducer state(in this case 'invalid_login')
The main idea is remove the DOM manipulation from the action.
Does it make sense?
Surely it makes sense. Actions must not receive any logic.
+1
@renancarvalho +1