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

clear-subscription-cache!clj/s

(clear-subscription-cache!)

Runs on-dispose for all subscriptions we have in the subscription cache. Used to force recreation of new subscriptions. Should only be necessary in development.

The on-dispose functions for the subscriptions will remove themselves from the cache.

Useful when reloading Figwheel code after a React exception, as React components aren't cleaned up properly. This means a subscription's on-dispose function isn't run when the components are destroyed. If a bad subscription caused your exception, then you can't fix it without reloading your browser.

Runs on-dispose for all subscriptions we have in the subscription cache.
Used to force recreation of new subscriptions. Should only be necessary
in development.

The on-dispose functions for the subscriptions will remove themselves from the
cache.

Useful when reloading Figwheel code after a React exception, as React components
aren't cleaned up properly. This means a subscription's on-dispose function isn't
run when the components are destroyed. If a bad subscription caused your exception,
then you can't fix it without reloading your browser.
sourceraw docstring

kindclj/s

source

query->reactionclj/s

source

reg-subclj/s

(reg-sub query-id & args)

Associate the given query id with a handler function and an optional signal function.

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 function, 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.
Associate the given `query id` with a handler function and an optional signal function.

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 function, 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

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