rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
sova-soars-the-sora 2020-09-23T23:54:19.000500Z

Hi everybody I'm conditionally mounting some components

sova-soars-the-sora 2020-09-23T23:54:25.000900Z

but apparently react doesn't like that style

sova-soars-the-sora 2020-09-23T23:54:56.001600Z

(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.

sova-soars-the-sora 2020-09-23T23:56:01.002700Z

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...

sova-soars-the-sora 2020-09-23T23:56:23.003200Z

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

sova-soars-the-sora 2020-09-23T23:56:31.003400Z

why is this bad x.x