Liking cljdoc? Tell your friends :D

re-frame.subs


cache-and-returnclj/s

(cache-and-return query-v dynv r)

cache the reaction r

cache the reaction r
sourceraw docstring

cache-lookupclj/s

(cache-lookup query-v)
(cache-lookup query-v dyn-v)
source

clear-all-handlers!clj/s

(clear-all-handlers!)

Unregisters all existing subscription handlers

Unregisters all existing subscription handlers
sourceraw docstring

kindclj/s

source

query->reactionclj/s

source

reg-subclj/s

(reg-sub query-id & args)

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.

  1. (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 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.
sourceraw docstring

register-rawclj/s

(register-raw query-id handler-fn)

Register a subscription handler fucntion for an query id

Register a subscription handler fucntion for an query id
sourceraw docstring

subscribeclj/s

(subscribe query-v)
(subscribe v dynv)

Returns a Reagent/reaction which contains a computation

Returns a Reagent/reaction which contains a computation
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close