(<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.
(cleanup! this)
Intended to be called when a component unmounts to clear the registered Reaction.
Intended to be called when a component unmounts to clear the registered Reaction.
(deflayer2-sub meta-sub-kw sub-name ?path)
Takes a symbol for a subscription name and a way to derive a path in your fulcro app db. 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])))
Takes a symbol for a subscription name and a way to derive a path in your fulcro app db. 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])))
(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.
(get-handler id)
Returns a "handler" function registered for the subscription with the given id
.
Fulcro app and 'query-id' -> subscription handler function.
Lookup in the place where the query-id -> handler functions are stored.
Returns a "handler" function registered for the subscription with the given `id`. Fulcro app and 'query-id' -> subscription handler function. Lookup in the place where the query-id -> handler functions are stored.
(get-input-db-signal app)
Given the storage for the subscriptions return an atom containing a map (this it the 'db' in re-frame parlance). this assumes you've set your fulcro app's state-atom to be reagent reactive atom.
Given the storage for the subscriptions return an atom containing a map (this it the 'db' in re-frame parlance). this assumes you've set your fulcro app's state-atom to be reagent reactive atom.
(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.
(register-handler! id handler-fn)
Returns handler-fn
after associng it in the map.
Returns `handler-fn` after associng it in the map.
(setup-reaction! this client-render)
Installs a Reaction on the provided component which will re-render the component when any of the subscriptions' values change.
Installs a Reaction on the provided component which will re-render the component when any of the subscriptions' values change.
(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.
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close