Fork me on GitHub
#reagent
<
2017-11-24
>
pesterhazy15:11:31

Have three states: nil, :log-in-success, :log-in-failure

pesterhazy15:11:10

don't render anything when the state is nil, and set it to one of those two values when you know what's going on

eveko15:11:48

okay, but where should the render be then? get-login-state is an ajax call and its sets the login atom, should the render be in the handler then?

pesterhazy15:11:42

render immediately on startup - but render an empty div or a spinner or whatever works for your app

pesterhazy15:11:17

that's what people do usually in React, or Reagent

eveko16:11:53

i am still not getting a desired result, it still renders the login ui instead of main even if login is set to true