Fork me on GitHub
#om
<
2017-07-07
>
danielstockton07:07:31

@samcf it needs to be a root query.

symfrog07:07:04

@samcf You should be able to use (parser {:state app-state} (om/full-query (om/class->any reconciler Component)))

danielstockton07:07:52

This needs to be documented.

the-kenny08:07:55

(cross-posting this question in #clojurescript from yesterday): Suppose I want to build a om.next application without using IQuery (by passing all props to children explicitly, etc., just like in om.core: Can I use om/transact! for mutations safely? Initial tests tell me I can, although I get scary warnings like Invariant Violation: transact! should be called on a component that implements IQuery or has a parent that implements IQuery

wilkerlucio13:07:17

@the-kenny that can be a bit weird, Om.next uses the queries to determine which components need re-render, that's how follow up reads work to refresh the screen, eg: (om/transact! [(some-mutation {}) :read/me], this will re-render the component that issued the query, plus any component that has :read/me on it's query, if you don't use the query then you may have to ask to re-render the entire thing all the times, which can get slow

the-kenny13:07:22

@wcohen Yeah, I thought of that. However, the most costliest part (dom updates) shouldn't happen because shouldComponentUpdate will return false if nothing changed, right? Basically the same behavior as in om.core when you don't use cursors to update the application state.

fenton22:07:01

@claudiu even with all remotes commented out I still get the reader function running twice. I remember reading about this somewhere but I can remember where/why.

petterik22:07:09

@fenton are you passing an empty vector to reconciler's :remote option?

fenton22:07:54

@petterik no. I tried just false, then I also just removed any remote references anywhere, ie remove the send parameter on the reconciled setup...

fenton23:07:23

@petterik ok i think i understand... as @claudiu said it's once for each local and once for each remote... even if I haven't defined any remotes there is one defined by default... :remote. So by default i have one local and one remote...