https://martinklepsch.org/posts/simple-debouncing-in-clojurescript.html
https://google.github.io/closure-library/api/goog.functions.html#debounce
This might be a noobie question but I’m wondering what would be the “recommended way” to create a reagent component which “takes as input” 2 other components and displays one or the other depending on some internal state. For example:
(defn hello-a [] [:div "a"])
(defn hello-b [] [:div "b"])
(def possibly-true? (zero? (rand-int 2)))
(defn choose-a-or-b
[{:keys [view-1 view-2]
(if possibly-true?
[view-1]
[view-2]))
(defn home-page
[]
[choose-a-or-b {:view-1 hello-a :view-2 hello-b}])
Your code is just fine. A regular HOC.
🙌