Skip to content

Instantly share code, notes, and snippets.

@hmaurer
Created January 24, 2019 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hmaurer/8fda06d34793b804355d85e5cec9741e to your computer and use it in GitHub Desktop.
Save hmaurer/8fda06d34793b804355d85e5cec9741e to your computer and use it in GitHub Desktop.
(defsc AppHeader [this {:keys [current-user]}]
{:query [{:current-user [:user/email]}]
:initial-state {}}
(div "Logged in as " (:user/email current-user)))
(def ui-app-header (prim/factory AppHeader))
(defsc App [this props]
{:query [{:>/app-header (prim/get-query AppHeader)} [df/marker-table '_]]
:initial-state (fn [params] {:>/app-header (prim/get-initial-state AppHeader {})})
:ident (fn [] [:screen :app])
:componentDidUpdate (fn [pp _] (ip/update-loading-visible! this pp))}
(if (prim/get-state this :loading-visible?)
(div "Loading...")
(ui-app-header (:>/app-header props))))
(def ui-app (prim/factory App))
(defsc Root [this props]
{:query [{:>/app (prim/get-query App)}]
:initial-state (fn [params] {:>/app (prim/get-initial-state App {})})}
(ui-app (:>/app props)))
; On Load:
(df/load elogic-beyond :>/app root/App {:marker [:screen :app]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment