A luxuriously simple and powerful way to make front-ends with DataScript and Reagent in Clojure.
travis ci
for one of my projects. I didnt setup the auto deploy myself but I think that the file is pretty self-explanatory. The only things that you would need to change are the your encripted env vars and your release config in project.clj
. Links below
(reg-query-sub
:cur-form-def
'[:find (pull ?e [*])
:in $
:where
[_ :designer/cur-form-id ?id]
[?e :form/id ?id]
])
[:code (pr-str @conn)]
inside my root component re-render on every db change?
debug-conn
here will work. Haven’t really stress tested it though might just be getting lucky. If you want to be more efficient you could rig up a listen!
on the conn.
build-defc
from rum, but couldn't get that to work either.
pull-all
in posh? I'm trying to write a pull-all version of this: https://github.com/denistakeda/re-posh/blob/master/src/re_posh/subs.cljc#L16p/pull
gives errors. I suspect because it returns a reaction
(which I don't really understand yet).
deref
after each individual pull (add it to your mapping function). This will give the value for the reaction. You may need to wrap the whole thing in a reagent.core/make-reaction
function if re-posh isn't doing that automatically where you are calling the derefs.
okay! So, I'm starting out with dat[ascript|omic] for the first time via re-posh and it's terrifying! I don't know how doing things works :sweat_smile: :
okay, so I have the following value in my app-db:
@re-frame.db/app-db
=> [{:db/id -1, :app/type :type/account, :account/balance 800}]
and I made a subscription like so:
(rp/reg-sub
:account-balance-id
(fn [_ _]
{:type :query
:query '[:find ?id .
:where [?id :app/type :type/account]]}))
:find ?id .
is for. I just copied it from the todomvc