Fork me on GitHub
#om
<
2017-02-23
>
drcode03:02:31

This is probably an easy question: What's the best way to say "all components on the page should refresh their queries"?

drcode03:02:34

(I have a background timer on my page, and every few minutes it'll run an auto-refresh in case another web user changed something that impacts the views for the current user)

devth03:02:04

not sure this is the best way but (om/update-query! root identity) should do it

drcode03:02:07

@devth thanks, that looks like it'll work for me!

anmonteiro03:02:34

@drcode just try (om/transact! this [])

anmonteiro03:02:39

feels less hacky

drcode03:02:04

@anmonteiro On root? I'll try it, thanks!

anmonteiro03:02:20

@drcode either that or on reconciler

anmonteiro03:02:34

keep in mind you can always transact! just a read

anmonteiro03:02:55

so like (om/transact! reconciler [:my-root-prop]) will re-render the whole tree

drcode03:02:07

@anmonteiro Right, but I was thinking the read statement would need to be really complex, but of course as you point out it doesn't because Om automatically refreshes the current component and its children.

qqq10:02:05

https://github.com/untangled-web/untangled-devguide/blob/master/src/devguide/untangled_devguide/B_UI_Exercises.cljs#L222 <-- how do I solve this? I know that "om-computed" is the correct way, but I want ot learn the hackish way first too

amorokh12:02:10

Has anyone tried using the new React Navigation (https://reactnavigation.org/) with om.next?

matthavener15:02:48

Is there an idiomatic pattern in om.next for rendering from two idents? I basically want my component to trigger render any time a specific child ident changes.

qqq19:02:46

correct me if I'm wrong, an om/next n00b passes data through (om/props this) and reads it off via keys an om/next wizard writes a datomic pull query and queries the db for the data to render

devth21:02:44

server side is there a way to determine the set of reads/mutations that will be fired, given a map of transit-params from the request?