Fork me on GitHub

@grounded_sage: i got this exercise to work, maybe your issue has to do with (om/computed people deletePerson) (it should be like (map (fn [person] (om-person (om/computed person {:onDelete #(js/console.log "delete" p)}))) people))


Yea that makes sense. Thanks I managed to get it. Must just be sleep deprived 😛


tree->db assumes for a 'many join' [{:foos (get-query Foo)}] that the first of the idents is the same for all the foos


should it?


hmm, my 'fix' would be to just always do the "union case" in "normalize many"


1.0.0-alpah34 released, @anmonteiro’s query updating stuff merged in, big change, so feedback welcome


No breaking changes here, even the router seems to work fine, will throw some 'big-data' at it


specifically, you want to be testing getting and setting queries


especially setting queries in 1-1 joins down the component hierarchy


and see if get-query of the root instance has the changes reflected


K, I'll throw in some of those scenarios


One thing I've been wondering: would it be a good idea to pass the reconciler to the send function? (provided by Om self) There are some scenarios where I want to run a bunch of mutations when something comes back from the server. Think user logs in, transact a mutation that redirects to some page, or show an error message things went wrong at the server. For now I have to do something like

(defn make-reconciler
  [{:keys [state parser merge merge-tree migrate id-key]}]
  (let [escape-hatchet (atom nil)
        config {:state state
                :parser parser
                :migrate migrate
                :id-key id-key
                :merge merge
                :merge-tree merge-tree
                :send (transit-post "/api" (assoc {} :reconciler  escape-hatchet))}
        reconciler (om/reconciler config)]
    (reset! escape-hatchet reconciler)
to avoid a circular dependency & have the reconciler available in my send function Is this outside the scope of Om self?


The merge function gets the reconciler, derefed app state, server response and the query request if that helps.


Though I wouldn't mind getting the reconciler in the send function. I have a case where I like to alter the state on certain read remotes, and it makes sense to do it in send, when I know what all the remote values are. You can potentially do the transact in the read function, when there is a remote target, but it didn't seem right to be doing transactions in the read function.


The docs on set-query! says that re-sends will happen when necessary. Anyone know how it is decided when it’s necessary? Tried looking into the set-query!-function but it’s a bit difficult to grasp


If the component that set-query! has anything in its query that causes a remote read, or if you specify any reads as a last argument to set-query!


Of course. I now see that it’s my read-fn that’s not being called at all for some reason