Last active
November 17, 2023 11:00
-
-
Save mynomoto/d701f0393c058fb528534e2e076691d0 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
(ns view.index | |
(:require | |
[hoplon.core :as h] | |
[javelin.core :as j])) | |
(j/defc cond-tpl-number 4) | |
(j/defc= is-4 (= cond-tpl-number 4)) | |
(defn cond-tpl-example | |
[] | |
(h/div | |
(h/h2 "cond-tpl") | |
(h/p (h/text "the number is: ~{cond-tpl-number}")) | |
; this form should show in the ui but doesn't | |
(h/cond-tpl is-4 (h/div "totally random!") | |
(j/cell= (= cond-tpl-number 0)) (h/div "something went wrong...") | |
(j/cell= (> cond-tpl-number 1)) (h/div "balloons") | |
:else (h/div "bananas")) | |
(h/button :click #(reset! cond-tpl-number (rand-int 5)) | |
"Change condition result"))) | |
(.replaceChildren (.getElementById js/document "app") | |
(cond-tpl-example)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment