Liking cljdoc? Tell your friends :D

reacl-c.main

Functions for using reacl-c within a browser application.

Functions for using reacl-c within a browser application.
raw docstring

execute-effectsclj/s

(execute-effects item & [options])

Returns an item that will intercept and execute all effects emitted by the given item. This is automatically wrapped around the toplevel item when using run, but not when using run-controlled.

Options can be a map with the following settings:

  • :recursion-limit When effects continue to return new effects, and exception is when thrown when this limit is reached (defaults to 1000),
  • :monitor A function called with the effect, its result value and a reacl-c.core/return value of actions and messages emitted by that effect.
Returns an item that will intercept and execute all effects
emitted by the given `item`. This is automatically wrapped around
the toplevel item when using [[run]], but not when
using [[run-controlled]].

Options can be a map with the following settings:

- `:recursion-limit`  When effects continue to return new effects, and exception is when thrown when this limit is reached (defaults to 1000),
- `:monitor`  A function called with the effect, its result value and a [[reacl-c.core/return]] value of actions and messages emitted by that effect.
sourceraw docstring

runcljs

(run dom item & [options])

Runs the given item as an application underneath the given native dom node, automatically managing its state and executing effect actions. Options are:

:initial-state: specifying the initial state of the item, which defaults to nil.

:handle-action!: a function called when the item emits an action (excluding effects); if not specified, and the item does emit an action, an error is thrown.

Runs the given item as an application underneath the given
native `dom` node, automatically managing its state and executing effect actions.
Options are:

`:initial-state`: specifying the initial state of the item, which defaults to nil.

`:handle-action!`: a function called when the item emits an
action (excluding effects); if not specified, and the item does emit
an action, an error is thrown.
sourceraw docstring

run-controlledcljs

(run-controlled dom item & [options])

Runs the given item as an application underneath the given native dom node. Options are:

:state: specifying the state of the item, which defaults to nil.

set-state!: a function that should handle a state change of the item; if not specified, and the item wants to change its state, an error is thrown.

handle-action!: a function called when the item emits an action (including effects); if not specified, and the item does emit an action, an error is thrown.

Runs the given item as an application underneath the given
native `dom` node. Options are:

`:state`: specifying the state of the item, which defaults to nil.

`set-state!`: a function that should handle a state change of the
item; if not specified, and the item wants to change its state, an
error is thrown.

`handle-action!`: a function called when the item emits an
action (including effects); if not specified, and the item does emit
an action, an error is thrown.
sourceraw docstring

send-message!clj/s

(send-message! app msg & [callback])

Sends a message to a running item, i.e. app must be the value returned from run or run-controlled. This can be used together with reacl-c.core/handle-message in situations where the application is not running standalone, but integrated in a different framework. The optional callback is invoked when any update triggered by the message is completed.

Sends a message to a running item, i.e. `app` must be the value
returned from [[run]] or [[run-controlled]]. This can be used together
with [[reacl-c.core/handle-message]] in situations where the
application is not running standalone, but integrated in a different
framework. The optional callback is invoked when any update
triggered by the message is completed.
sourceraw docstring

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

× close