This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-23
Channels
- # aws-lambda (1)
- # bangalore-clj (13)
- # beginners (12)
- # boot (3)
- # cider (1)
- # cljs-dev (20)
- # clojure (208)
- # clojure-finland (1)
- # clojure-france (1)
- # clojure-russia (30)
- # clojure-serbia (12)
- # clojure-spec (7)
- # clojure-uk (14)
- # clojurescript (16)
- # cursive (6)
- # datomic (10)
- # emacs (1)
- # hoplon (4)
- # keechma (14)
- # leiningen (2)
- # off-topic (6)
- # om (43)
- # onyx (32)
- # pedestal (8)
- # perun (2)
- # re-frame (7)
- # reagent (33)
- # specter (5)
- # vim (4)
- # yada (9)
Is there a good way to get the reconciler to queue a send of the entire root query to a particular remote every time the state changes?
@peeja Everytime the state changes on the client or on the server?
On the client, could you use TxListen?
On the server, I push some change notifications of a read that's changed along with datomic's basis-t. Using basis-t (or something similiar) I can avoid sending requests I've already read data for when there are frequent updates. I use (om/transform-reads reconciler [:key-to-read])
to queue the reads locally and remotely.
Lastly, to find all reads for a specific remote, could you maybe call (and memoize) (keys (parser env (om/query (om/app-root reconciler)) remote))
?
I tried swap!
ing the state and didn't see it, but perhaps transact!
will always do what I need
Yeah. Firing off another transact!
in :tx-listen
depending on what was transacted or what's being transacted maybe?
My plan is to have something stateful stay informed of changes to the query, and adjust the live data it listens for appropriately
which means it always needs a new copy of entire root query any time it (may) change, to run a diff
What if you put this stateful thing in :shared
and call it either from your root component everytime it updates, or via :tx-listen
depending on what you need
2 (the way I'm doing it), wrap your parser in a function which looks for a dynamic var, for example *allowed-remotes*
, and returns nil
if the env's :target
is not in *allowed-remotes*
. Binding it using binding
(binding [*allowed-remotes* #{:the-remote-you-want}] (om/transact! reconciler (om/get-query (om/app-root reconciler))))
would get the full query with only the remote you want
Can I accomplish the same thing by force
ing the remote? I'm not entirely clear on what that does.