-
-
Save hmaurer/8fda06d34793b804355d85e5cec9741e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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