This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-23
Channels
- # announcements (2)
- # architecture (16)
- # babashka (26)
- # beginners (106)
- # calva (173)
- # chlorine-clover (19)
- # cider (36)
- # cljdoc (4)
- # clojure (113)
- # clojure-berlin (3)
- # clojure-czech (3)
- # clojure-dev (5)
- # clojure-europe (37)
- # clojure-france (3)
- # clojure-hamburg (12)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-uk (22)
- # clojurescript (38)
- # cryogen (10)
- # cursive (30)
- # data-science (7)
- # datascript (1)
- # datomic (13)
- # deps-new (7)
- # depstar (13)
- # duct (3)
- # events (2)
- # exercism (3)
- # fulcro (31)
- # graalvm (56)
- # graphql (1)
- # helix (5)
- # java (12)
- # jobs-discuss (19)
- # kaocha (13)
- # luminus (1)
- # lumo (4)
- # malli (5)
- # off-topic (17)
- # parinfer (1)
- # pathom (1)
- # pedestal (7)
- # rdf (10)
- # re-frame (1)
- # remote-jobs (7)
- # rum (6)
- # shadow-cljs (4)
- # tools-deps (41)
- # uncomplicate (3)
- # vim (14)
Hi everybody I'm conditionally mounting some components
but apparently react doesn't like that style
(rum/defc cumulative-quiz < rum/reactive
{:key-fn (fn [] (str "quizd-cumulative" (swap! ugen inc)))} []
(println @rand-int-majore " = majore")
(if (= 0 (rum/react rand-int-majore)) ;VERBQUIZ
(rum/mount (verb-quiz-cumulative) (. js/document (getElementById "app"))))
(if (= 1 (rum/react rand-int-majore)) ;;;KANJIQUIZ
(rum/mount (kanji-quiz-cumulative) (. js/document (getElementById "app"))))
(if (= 2 (rum/react rand-int-majore)) ;;PARTICLE quiz
(rum/mount (particle-quiz-cumulative) (. js/document (getElementById "app")))))
Here I am combining 3 elements into one and I thought I could just conditionally rum/mount the relevant one.how would you conditionally show 1 of 3 slides and randomly move to the next one? for example, you have slide A, B, C, each with on-the-fly data... how would you show A or Bor C and then randomly draw again and show A or B or C...
I figured I could just store an atom with a value 0 1 2 and randomly roll it every time I needed the update, and have the component selectively mount pieces
why is this bad x.x