Fork me on GitHub

is there an large open source webapp in using rum? I'd like to study how people write larger apps with rum


i have a component that sets the select tag value based on the value of and atom, I'm using rum/react & rum/reactive, but sometimes the element does not update


i remember when working with om that there was some workaround needed to update certain input elements, is that the case with rum as well?


(rum/defc select < rum/reactive [cursor {:keys [options label]}]
   [:label label]
   (into [:select.form-control
          {:value (or (rum/react cursor) "")
           :on-change (fn [dom-event] (reset! cursor (read-string (.. dom-event -target -value))))}]
         (for [ [i o] (map vector (range) options)]
           [:option {:value (pr-str o)} (name o)]))])


@chrisblom so you are saying that if you log the (read-string... form you’ll receive events that are sometimes not reflected in the ui?


generally both om and rum have a common problem, which is that because they batch updates, on-change events can get swallowed and cause other kinds of re-renders. supposedly the sablono library that they both rely upon fixes this problem but maybe you found another issue?


thanks, the events get swallowed, i've fixed it now by calling rum/request-render


@chrisblom if you have a small repro you should really file a bug. that shouldn’t be required


yeah, i'll see if i can make a minimal testcase


@chrisblom I've come across this issue too i think. My solution was to not re-render the select, but rely on the native state and kept the changed value in some other atom


the problem was the the native state and the atom get out of sync

Garrett Hopper22:01:20

I'm getting a no such namespace "prum-preact" when trying to use prum. I've tried adding "prum-preact" to :npm-deps, but I'm not having any luck. Any ideas?

Garrett Hopper22:01:30

:install-deps too. (I'm using boot-cljs, btw)