(disable-subscriptions item)
(disable-subscriptions item subs)
Returns an item like item
, but where all subscriptions (or the
the given subscriptions) are not executed when emitted from item
.
Returns an item like `item`, but where all subscriptions (or the the given subscriptions) are not executed when emitted from `item`.
(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.
(emulate-subscriptions item f)
Returns an item, that for all subscriptions done in item
,
evaluates (f subscription-effect)
. The
function [[subscription-effect?]] can be used to check which kind of
subscription effect it is. If it evaluates to nil
or the same
effect that was passed in, it is just passed on. If it evaluates to
a different action, that action is emitted from the subscription
itself, i.e. emulating a (synchronous) result of the subscription.
Returns an item, that for all subscriptions done in `item`, evaluates `(f subscription-effect)`. The function [[subscription-effect?]] can be used to check which kind of subscription effect it is. If it evaluates to `nil` or the same effect that was passed in, it is just passed on. If it evaluates to a different action, that action is emitted from the subscription itself, i.e. emulating a (synchronous) result of the subscription.
(env item & [options])
Returns a new test environment to test the behavior of the given item.
Returns a new test environment to test the behavior of the given item.
(execute-effect! env eff)
Executed the given effect in the given test environment, and return toplevel changes as a 'return' value.
Executed the given effect in the given test environment, and return toplevel changes as a 'return' value.
(inject-action! comp action)
Does the things that would happen if the given component emitted the given action, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
Does the things that would happen if the given component emitted the given action, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
(inject-action!! comp action)
Like inject-action!
, but also recursively update the item to new states that are returned.
Like [[inject-action!]], but also recursively update the item to new states that are returned.
(inject-return! comp ret)
Does the things that would happen if the given component returned the given 'return' value in reaction to some discrete event, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
Does the things that would happen if the given component returned the given 'return' value in reaction to some discrete event, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
(inject-return!! comp ret)
Like inject-return!
, but also recursively update the item to new states that are returned.
Like [[inject-return!]], but also recursively update the item to new states that are returned.
(inject-state-change! comp state)
Does the things that would happen if the given component emitted the given new state, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
Does the things that would happen if the given component emitted the given new state, and returns what would be emitted (state and/or actions) from the tested item, in the form of a 'return' value.
(inject-state-change!! comp state)
Like inject-state-change!
, but also recursively update the item to new states that are returned.
Like [[inject-state-change!]], but also recursively update the item to new states that are returned.
(invoke-callback! comp callback event)
Invokes the function assiciated with the given callback
of the
given test component of a dom element (e.g. :onclick
), with the
given event object, and returns a changed app-state and actions from
the toplevel item, in the form of a reacl/return
value.
Invokes the function assiciated with the given `callback` of the given test component of a dom element (e.g. `:onclick`), with the given event object, and returns a changed app-state and actions from the toplevel item, in the form of a `reacl/return` value.
(invoke-callback!! comp callback event)
Like invoke-callback!
, but also recursively update the item to new states that are returned.
Like [[invoke-callback!]], but also recursively update the item to new states that are returned.
(mount! env state)
Mounts the item of the given test environment with the given state, and returns actions and maybe a changed state.
Mounts the item of the given test environment with the given state, and returns actions and maybe a changed state.
(mount!! env state)
Like mount!
, but also recursively update the item to new states that are returned.
Like [[mount!]], but also recursively update the item to new states that are returned.
(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.
Prevents a log message about an exception during the evaluation of `thunk`, which occurs even when the error is handled in an error boundary.
(push! env ret)
Apply the state change in the given 'return' value, if there is any, and merge the return value resulting from that - pushing the update cycle one turn.
Apply the state change in the given 'return' value, if there is any, and merge the return value resulting from that - pushing the update cycle one turn.
(push!! env ret)
Recursively apply the state change in the given 'return' value, until the state does not change anymore.
Recursively apply the state change in the given 'return' value, until the state does not change anymore.
(send-message! comp msg)
Sends a message to the given component or the toplevel component of the given test environment, and returns actions and maybe a changed state.
Sends a message to the given component or the toplevel component of the given test environment, and returns actions and maybe a changed state.
(send-message!! comp msg)
Like send-message!
, but also recursively update the item to new states that are returned.
Like [[send-message!]], but also recursively update the item to new states that are returned.
(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]].
(subscribe-effect-args eff)
The arguments passed to the subscription the given subscribe effect was generated from.
The arguments passed to the subscription the given subscribe effect was generated from.
(subscribe-effect-fn eff)
The function passed to the subscription the given subscribe effect was generated from.
The function passed to the subscription the given subscribe effect was generated from.
(subscribe-effect? eff)
(subscribe-effect? eff subs)
Tests if the given effect, is one that is emitted by a subscription equal to the given one on mount. This can be useful in unit tests.
Tests if the given effect, is one that is emitted by a subscription equal to the given one on mount. This can be useful in unit tests.
(unmount! env)
Unmounts the item of the given test environment, and return actions and maybe a changed state.
Unmounts the item of the given test environment, and return actions and maybe a changed state.
(unmount!! env)
Like unmount!
, but also recursively update the item to new states that are returned.
Like [[unmount!]], but also recursively update the item to new states that are returned.
(update! env state)
Updates the state of the item of the given test environment, and returns actions and maybe a changed state.
Updates the state of the item of the given test environment, and returns actions and maybe a changed state.
(update!! env state)
Updates the state of the item of the given test environment, and if the state is changed in reaction to that, then keeps on updating it. Returns actions and the final changed state, if it was changed at all. Throws if there are more than max-update-loops recursions, which are a sign for bug in the item.
Updates the state of the item of the given test environment, and if the state is changed in reaction to that, then keeps on updating it. Returns actions and the final changed state, if it was changed at all. Throws if there are more than *max-update-loops* recursions, which are a sign for bug in the item.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close