(cache-and-return query-v dynv r)
cache the reaction r
cache the reaction r
(clear-all-handlers!)
Unregisters all existing subscription handlers
Unregisters all existing subscription handlers
(reg-sub query-id & args)
Register a given handler function for a given query id.
There's 3 ways this function can be called
(reg-sub :test-sub (fn [db [_]] db)) The value in app-db is passed to the computation function as the 1st argument.
(reg-sub :a-b-sub (fn [q-vec d-vec] [(subs/subscribe [:a-sub]) (subs/subscribe [:b-sub])]) (fn [[a b] [_]] {:a a :b b}))
Two functions provided. The 2nd is computation fucntion, as before. The 1st
is returns what input signals
should be provided to the computation. The
input signals
function is called with two arguments: the query vector
and the dynamic vector. The return value can be singleton reaction or
a sequence of reactions.
input signals
functions. :<-
is supplied followed by the subscription
vector.Register a given handler function for a given query id. There's 3 ways this function can be called 1. (reg-sub :test-sub (fn [db [_]] db)) The value in app-db is passed to the computation function as the 1st argument. 2. (reg-sub :a-b-sub (fn [q-vec d-vec] [(subs/subscribe [:a-sub]) (subs/subscribe [:b-sub])]) (fn [[a b] [_]] {:a a :b b})) Two functions provided. The 2nd is computation fucntion, as before. The 1st is returns what `input signals` should be provided to the computation. The `input signals` function is called with two arguments: the query vector and the dynamic vector. The return value can be singleton reaction or a sequence of reactions. 3. (reg-sub :a-b-sub :<- [:a-sub] :<- [:b-sub] (fn [[a b] [_]] {:a a :b b}))``` This 3rd variation is just syntactic sugar for the 2nd. Pairs are supplied instead of an `input signals` functions. `:<-` is supplied followed by the subscription vector.
(register-raw query-id handler-fn)
Register a subscription handler fucntion for an query id
Register a subscription handler fucntion for an query id
(subscribe query-v)
(subscribe v dynv)
Returns a Reagent/reaction which contains a computation
Returns a Reagent/reaction which contains a computation
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close