(cache-and-return! get-subscription-cache
get-cache-key
app
query-v
reaction-or-cursor)
cache the reaction reaction-or-cursor
cache the reaction reaction-or-cursor
(clear-subscription-cache! get-subscription-cache app)
calls on-dispose
for each cached item,
which will cause the value to be removed from the cache
calls `on-dispose` for each cached item, which will cause the value to be removed from the cache
(deflayer2-sub meta-sub-kw get-input-db-signal def-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])))
(defsubraw meta-sub-kw get-input-db-signal sub-name args body)
Creates a subscription function that takes the datasource ratom and optionally an args map and returns a Reaction or RCursor type.
Creates a subscription function that takes the datasource ratom and optionally an args map and returns a Reaction or RCursor type.
(lenient-call f datasource args)
Deal with arity stricness on JVM
Deal with arity stricness on JVM
(make-subs-handler-fn inputs-fn computation-fn query-id)
A subscription is just a function that returns a reagent.Reaction.
This is where the inputs-fn is executed and the computation is put inside a reaction - ie a callback for later invocation when subscribe is called and derefed.
A subscription is just a function that returns a reagent.Reaction. This is where the inputs-fn is executed and the computation is put inside a reaction - ie a callback for later invocation when subscribe is called and derefed.
(map-signals f signals)
Runs f over signals. Signals may take several forms, this function handles all of them.
Runs f over signals. Signals may take several forms, this function handles all of them.
(map-vals f m)
Returns a new version of 'm' in which 'f' has been applied to each value. (map-vals inc {:a 4, :b 2}) => {:a 5, :b 3}
Returns a new version of 'm' in which 'f' has been applied to each value. (map-vals inc {:a 4, :b 2}) => {:a 5, :b 3}
(reg-layer2-sub get-input-db-signal register-handler! 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.
(reg-sub get-input-db-signal
get-handler
register-handler!
get-subscription-cache
cache-lookup
get-cache-key
query-id
&
args)
db, fully qualified keyword for the query id optional positional args.
db, fully qualified keyword for the query id optional positional args.
(sub-fn meta-sub-kw 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 get-handler
cache-lookup
get-subscription-cache
get-cache-key
datasource
query)
Takes a datasource and query and returns a Reaction.
Takes a datasource and query and returns a Reaction.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close