Fork me on GitHub
#om
<
2016-08-30
>
hlolli10:08:38

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

julianwegkamp12:08:21

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

niamu12:08:06

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

ethangracer18:08:12

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)})

...

anmonteiro18:08:57

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

ethangracer18:08:32

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

ethangracer18:08:25

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

ethangracer18:08:36

not a huge deal though