(collect-actions item atom)
Returns an item that is like item
, but will capture all emitted actions and
conj them into the given atom instead.
Returns an item that is like `item`, but will capture all emitted actions and conj them into the given atom instead.
(effect-args eff)
Returns the arguments for the function returned by effect-f
.
Returns the arguments for the function returned by [[effect-f]].
(effect-f eff)
Returns the function implementing the effect behind the given simple effect action. See simple-effect?
.
Returns the function implementing the effect behind the given simple effect action. See [[simple-effect?]].
(effect? a & [eff-defn])
Returns true if the given action is an effect action, and optionally if it was created by the given effect function.
Returns true if the given action is an effect action, and optionally if it was created by the given effect function.
(map-subscriptions item f)
Returns an item that replaces subscriptions in item
. Note that
item
itself remains unchanged; instead, whenever a subscription is
activated in item
, f
will be called with that subscription, and
if it returns a different subscription, then that is activated
instead. If it returns nil, then the original subscription will be
actived.
You can use subscription?
and subscription-args
, if the
replacement depends on details of the subscription or for mapping a
whole group of subscriptions.
Returns an item that replaces subscriptions in `item`. Note that `item` itself remains unchanged; instead, whenever a subscription is activated in `item`, `f` will be called with that subscription, and if it returns a different subscription, then that is activated instead. If it returns nil, then the original subscription will be actived. You can use [[subscription?]] and [[subscription-args]], if the replacement depends on details of the subscription or for mapping a whole group of subscriptions.
(preventing-error-log thunk)
Prevents a log message about an exception during the evaluation of
thunk
, which occurs even when the error is handled in an error
boundary. If thunk
returns a promise, then error logs are enabled
after that completes instead.
Prevents a log message about an exception during the evaluation of `thunk`, which occurs even when the error is handled in an error boundary. If `thunk` returns a promise, then error logs are enabled after that completes instead.
(provided bindings & body)
Replaces the values bound to the given vars during the
evaluation of body
, and sets them back to the previous values
afterwards. Example:
(def x 42)
(provided [x 11]
(is (= (* x 2) 22)))
(is (= x 42))
Replaces the values bound to the given vars during the evaluation of `body`, and sets them back to the previous values afterwards. Example: ``` (def x 42) (provided [x 11] (is (= (* x 2) 22))) (is (= x 42)) ```
(run-effect! eff)
Returns a tuple [value ret]
. If an effect returns a reacl-c.core/return
value, then 'value' is the returned state, and 'ret' everything else.
For any other value, 'ret' is empty.
Returns a tuple `[value ret]`. If an effect returns a [[reacl-c.core/return]] value, then 'value' is the returned state, and 'ret' everything else. For any other value, 'ret' is empty.
(run-subscription! sub deliver!)
Calls the function implementing the given subscription with the given
deliver!
function, returning the stop function for it.
Calls the function implementing the given subscription with the given `deliver!` function, returning the stop function for it.
(simple-effect? a & [eff-defn])
Returns true for effects created by [[core/effect]] or [[core/defn-effect]], but false for those created from [[core/seq-effects]].
Returns true for effects created by [[core/effect]] or [[core/defn-effect]], but false for those created from [[core/seq-effects]].
(subscription-args sub)
Returns extra arguments for the function implementing the given subscription item. See subscription-f
Returns extra arguments for the function implementing the given subscription item. See [[subscription-f]]
(subscription-f sub)
Returns the function implementing the given subscription item.
Returns the function implementing the given subscription item.
(subscription-results sub num-actions & [timeout-ms])
Runs the given subscription, asynchronously waiting for at least the given number of actions emitted by it (or the given timeout elapses), and then stops the subscription. Returns a promise of the sequence of actions.
Runs the given subscription, asynchronously waiting for at least the given number of actions emitted by it (or the given timeout elapses), and then stops the subscription. Returns a promise of the sequence of actions.
(subscription? v)
(subscription? v f)
Returns whether item
is a subscription item, optinally also
checking if it was created by the given defn-subscription
function
or with the given function f
as its implementation.
Returns whether `item` is a subscription item, optinally also checking if it was created by the given `defn-subscription` function or with the given function `f` as its implementation.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close