Skip to content

Instantly share code, notes, and snippets.

Created January 24, 2019 23:48
What would you like to do?
(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