reactjs - Flux architecture for a login or basically most forms processing -


i trying understand bit more flux architecture , designing simple login component. suppose when login (post ajax) , error comes back. how information flow in flux?

  1. i think logincomponent should work on handlesubmit function.
  2. after ajax call comes error , message should component create action such "updateloginstatus payload {message: "no e-mail found"}. trigger loginstore or save status message , emit event such "loginstatusmessagechanged".
  3. another totally different component called loginstatusmessage register listen events on loginstore. notified of event , proceede update it's own state message. go out loginstore , fetch message , display user via render.

i believe example covere question quite well: https://github.com/przeor/react-router-flux-starter-kit/


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -