om

Please ask the channel first, not @dnolen directly!
claudiu 2017-05-03T04:37:28.529385Z

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

claudiu 2017-05-03T06:51:51.318683Z

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

claudiu 2017-05-03T06:53:00.327429Z

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

๐Ÿ‘ 1
2017-05-03T08:04:24.028124Z

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

claudiu 2017-05-03T11:34:28.512349Z

ohh youโ€™re right. Thank you ๐Ÿ™‚

claudiu 2017-05-03T11:37:27.544929Z

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 ?

claudiu 2017-05-03T11:38:02.551102Z

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

2017-05-03T12:23:18.092552Z

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.