login-flow icon indicating copy to clipboard operation
login-flow copied to clipboard

Remove some responsibilities from action

Open renancarvalho opened this issue 8 years ago • 2 comments

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?

renancarvalho avatar Apr 06 '16 20:04 renancarvalho

Surely it makes sense. Actions must not receive any logic.

+1

renatorib avatar Jul 04 '16 05:07 renatorib

@renancarvalho +1

kopax avatar Oct 17 '16 21:10 kopax