#37: Well, THAT was easy!

Protective wrapper around :page rendering so that the initial, transient null value doesn't get rendered!
This commit is contained in:
Simon Brooke 2017-03-29 06:40:04 +01:00
parent b1956def91
commit 72b4f058ed

View file

@ -71,11 +71,16 @@
:map #'map-page
})
(defn page []
(defn page
"Render the single page of the app, taking the current panel from
the :page key in the state map."
[]
[:div
[:header
[ui/navbar]]
[(pages @(rf/subscribe [:page]))]])
[:header
[ui/navbar]]
(let [content (pages @(rf/subscribe [:page]))]
(if content [content]
[:div.error (str "No content in page " :page)]))])
;; -------------------------
;; Routes