Fork me on GitHub

I'm re-encountering a problem that I forgot how I solved. Its about om/set-query!, after it runs I lose all my local state. Anyone had that or has idea about what is happening? (lesson learned, dont call a factory within re-renderable defui, rather define it outside and call it).


@niamu Thx for the link. So I assume! is the right function to use for updates that are initiated from outside the om app?


@julianwegkamp: I believe so. I just know that the callback function wraps it. In my own experience I’ve had trouble with the callback when using Datascript as the client database as opposed to just an atom. Still learning about this myself. Doing code searches on GitHub helps to see how others solve the problems.


has anyone tried immediately nested union queries? e.g.

(defui Switcher ...
 (query [this] {:panelA (om/get-query PanelA)
                  :panelB (om/get-query PanelB)}))

(defui PanelA ...
  (query [this] {:view1 (om/get-query View1)
                   :view2 (om/get-query View2)})



@ethangracer I don’t think it has been tried but I also believe your example might not be valid


that was my thinking too — it seems like it would be impossible to configure the app state in such a way


it’s easy enough to create a component that separates the two, but if all it does it pass down props it seems like unnecessary overhead


not a huge deal though