(add-on-dispose! a-ratom f)
On JVM Clojure, use an atom to register f
to be invoked when dispose!
is
invoked with a-ratom
.
On JVM Clojure, use an atom to register `f` to be invoked when `dispose!` is invoked with `a-ratom`.
(dispose! a-ratom)
On JVM Clojure, invoke all callbacks registered with add-on-dispose!
for
a-ratom
.
On JVM Clojure, invoke all callbacks registered with `add-on-dispose!` for `a-ratom`.
(in-reactive-context body)
(in-reactive-context obj body)
Macro that emits the body
form with the reagent.ratom/ratom-context dynamically bound either to a fresh object
or to the provided object obj
.
Macro that emits the `body` form with the reagent.ratom/*ratom-context* dynamically bound either to a fresh object or to the provided object `obj`.
(make-reaction f)
On JVM Clojure, return a deref
-able thing which invokes the given function
on every deref
. That is, make-reaction
here provides precisely none of the
benefits of reagent.ratom/make-reaction
(which only invokes its function if
the reactions that the function derefs have changed value). But so long as f
only depends on other reactions (which also behave themselves), the only
difference is one of efficiency. That is, your tests should see no difference
other than that they do redundant work.
On JVM Clojure, return a `deref`-able thing which invokes the given function on every `deref`. That is, `make-reaction` here provides precisely none of the benefits of `reagent.ratom/make-reaction` (which only invokes its function if the reactions that the function derefs have changed value). But so long as `f` only depends on other reactions (which also behave themselves), the only difference is one of efficiency. That is, your tests should see no difference other than that they do redundant work.
(reagent-id reactive-val)
Doesn't make sense in a Clojure context currently.
Doesn't make sense in a Clojure context currently.
Produces an id for reactive Reagent values e.g. reactions, ratoms, cursors.
Produces an id for reactive Reagent values e.g. reactions, ratoms, cursors.
(run-in-reaction f obj key run opts)
Evaluates f
and returns the result. If f
calls deref
on any ratoms,
creates a new Reaction that watches those atoms and calls run
whenever
any of those watched ratoms change. Also, the new reaction is added to
list of 'watches' of each of the ratoms. The run
parameter is a function
that should expect one argument. It is passed obj
when run. The opts
are any options accepted by a Reaction and will be set on the newly created
Reaction. Sets the newly created Reaction to the key
on obj
.
Evaluates `f` and returns the result. If `f` calls `deref` on any ratoms, creates a new Reaction that watches those atoms and calls `run` whenever any of those watched ratoms change. Also, the new reaction is added to list of 'watches' of each of the ratoms. The `run` parameter is a function that should expect one argument. It is passed `obj` when run. The `opts` are any options accepted by a Reaction and will be set on the newly created Reaction. Sets the newly created Reaction to the `key` on `obj`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close