Fork me on GitHub
#om
<
2017-05-03
>
claudiu04:05:28

@petterik Thank you. Seems to work nicely for the initial page load (if I’m on the route). But if I change the route remote does not kick in. Am I doing something wrong ?

claudiu06:05:51

really like the flow of om-next but really seems tricky to get started. Found what was the gotcha.

claudiu06:05:00

(om/transact! c `[(~'change/route! {:route ~route})]))
should be
(om/transact! c `[(~'change/route! {:route ~route}) :route/data]))
so that it re-reads the union query and checks for remotes.

danielstockton08:05:24

@claudiu ~' seems unnecessary, you're quoting and unquoting. Just omit those two characters.

claudiu11:05:28

ohh you’re right. Thank you 🙂

claudiu11:05:27

calling transact on a component seems to also trigger the remote. But if call with the reconciler it seems to just re-read from local state. Anyone know if this is the expected behaviour ?

claudiu11:05:02

(om/transact! (om/get-reconciler c) `[(change/route! {:route ~route}) :route/data])) 
vs
(om/transact!  c  `[(change/route! {:route ~route}) :route/data]))

danielstockton12:05:18

It looks like it doesn't call transform-reads if you pass a reconciler: https://github.com/omcljs/om/blob/master/src/main/om/next.cljc#L1568 transform-reads is replacing simple reads like :route/data with the full query of the components that care about that read.