Liking cljdoc? Tell your friends :D

space.matterandvoid.subscriptions.impl.core


<subclj/s

(<sub app query)

Subscribe and deref a subscription, returning its value, not a reaction.

Subscribe and deref a subscription, returning its value, not a reaction.
sourceraw docstring

cache-lookupclj/s

(cache-lookup datasource cache-key)
source

clear-handlersclj/s

(clear-handlers _db)
(clear-handlers _db id)
source

clear-subclj/s

(clear-sub registry)
(clear-sub registry query-id)
source

clear-subscription-cache!clj/s

(clear-subscription-cache! registry)

Removes all subscriptions from the cache.

Removes all subscriptions from the cache.
sourceraw docstring

deflayer2-subcljmacro

(deflayer2-sub meta-sub-kw sub-name ?path)

Only supports use cases where your datasource is a hashmap.

Takes a symbol for a subscription name and a way to derive a path in your datasource hashmap. Returns a function subscription which itself returns a Reagent RCursor. Supports a vector path, a single keyword, or a function which takes the RAtom datasource and the arguments map passed to subscribe and must return a path vector to use as an RCursor path.

Examples:

(deflayer2-sub my-subscription :a-path-in-your-db)

(deflayer2-sub my-subscription [:a-path-in-your-db])

(deflayer2-sub my-subscription (fn [db-atom sub-args-map] [:a-key (:some-val sub-args-map])))

Only supports use cases where your datasource is a hashmap.

Takes a symbol for a subscription name and a way to derive a path in your datasource hashmap. Returns a function subscription
which itself returns a Reagent RCursor.
Supports a vector path, a single keyword, or a function which takes the RAtom datasource and the arguments map passed to subscribe and
must return a path vector to use as an RCursor path.

Examples:

(deflayer2-sub my-subscription :a-path-in-your-db)

(deflayer2-sub my-subscription [:a-path-in-your-db])

(deflayer2-sub my-subscription (fn [db-atom sub-args-map] [:a-key (:some-val sub-args-map])))
sourceraw docstring

defsubrawcljmacro

(defsubraw meta-sub-kw sub-name args body)

Creates a subscription function that takes the datasource ratom and optionally an args map and returns the subscription value. The return value is wrapped in a Reaction for you, so you do not need to.

Creates a subscription function that takes the datasource ratom and optionally an args map and
returns the subscription value. The return value is wrapped in a Reaction for you, so you do not need to.
sourceraw docstring

deref-input-signalsclj/s

source

get-cache-keyclj/s

(get-cache-key _app [query-key :as query-v])
source

get-handlerclj/s

(get-handler id)
source

get-input-db-signalclj/s

(get-input-db-signal ratom)
source

get-subscription-cacheclj/s

(get-subscription-cache _app)
source

handler-registry_clj/s

source

make-sub-fnclj/s

(make-sub-fn meta-sub-kw query-id sub-args)
source

parse-reg-sub-argsclj/s

(parse-reg-sub-args args)
source

reg-layer2-subclj/s

(reg-layer2-sub query-id path-vec-or-fn)

Registers a handler function that returns a Reagent RCursor instead of a Reagent Reaction. Accepts a single keyword, a vector path into or a function which takes your db atom and arguments map passed to subscribe and must return a vector path to be used for the cursor.

Registers a handler function that returns a Reagent RCursor instead of a Reagent Reaction.
Accepts a single keyword, a vector path into or a function which takes your db atom and arguments map passed to subscribe
and must return a vector path to be used for the cursor.
sourceraw docstring

reg-subclj/s

(reg-sub query-id & args)
source

reg-sub-rawclj/s

(reg-sub-raw query-id handler-fn)
source

register-handler!clj/s

(register-handler! id handler-fn)

Returns handler-fn after associng it in the map.

Returns `handler-fn` after associng it in the map.
sourceraw docstring

set-args-merge-fn!clj/s

(set-args-merge-fn! f)
source

set-memoize-fn!clj/s

(set-memoize-fn! f)
source

sub-fnclj/s

(sub-fn meta-fn-key f)

Takes a function that returns either a Reaction or RCursor. Returns a function that when invoked delegates to f and derefs its output. The returned function can be used in subscriptions.

Takes a function that returns either a Reaction or RCursor. Returns a function that when invoked delegates to `f` and
derefs its output. The returned function can be used in subscriptions.
sourceraw docstring

sub-fn->sub-nameclj/s

(sub-fn->sub-name sub-fn)
source

sub-meta-name-kw*clj/s

source

sub-missing-name!clj/s

(sub-missing-name! sub-fn)
source

subs-cache_clj/s

source

subs-state-pathclj/s

(subs-state-path k)
source

subscribeclj/s

(subscribe app query)

Given a query vector, returns a Reagent reaction which will, over time, reactively deliver a stream of values. Also known as a Signal.

To obtain the current value from the Signal, it must be dereferenced

Given a `query` vector, returns a Reagent `reaction` which will, over
time, reactively deliver a stream of values. Also known as a `Signal`.

To obtain the current value from the Signal, it must be dereferenced
sourceraw docstring

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

× close