Provides a DB for JS objects and DOM nodes.
Items are indexed by entity references obtained through the
reflet.core/with-ref
macro, and cleaned up when their React
component unmounts. Do not use refs that were not created by
with-ref
unless you are prepared to clean them up yourself.
Provides a DB for JS objects and DOM nodes. Items are indexed by entity references obtained through the `reflet.core/with-ref` macro, and cleaned up when their React component unmounts. Do not use refs that were not created by `with-ref` unless you are prepared to clean them up yourself.
(el! ref & {:keys [flush mount]})
Returns a react callback for initializing a DOM element ref and putting it into the interop db. Signal is only initialized once.
Options include:
:mount Callback function is called after DOM element is mounted. Accepts the DOM element as it's only argument.
:flush Flushes the reagent ratom queue for immediate computation
Returns a react callback for initializing a DOM element ref and putting it into the interop db. Signal is only initialized once. Options include: :mount Callback function is called after DOM element is mounted. Accepts the DOM element as it's only argument. :flush Flushes the reagent ratom queue for immediate computation
(grab ref)
The preferred function for accessing objects in non-reactive contexts. We do not bother with co-effects. Operations on the DOM or on JS objects are inherently mutable, and not pure.
The preferred function for accessing objects in non-reactive contexts. We do not bother with co-effects. Operations on the DOM or on JS objects are inherently mutable, and not pure.
(id ref)
DOM element ids cannot start with a number.
DOM element ids cannot start with a number.
(reg ref obj)
(reg ref obj opts)
Stores the interop object in the object DB. Optionally accepts a
spec with a single key, :destroy
. If a destroy fn is provided,
that function will be run at tear-down with the obj as argument.
Stores the interop object in the object DB. Optionally accepts a spec with a single key, `:destroy`. If a destroy fn is provided, that function will be run at tear-down with the obj as argument.
(update! ref f & args)
Semantics like clojure.core/update
, mutates the object in db by
running the function with existing object as parameter.
Semantics like `clojure.core/update`, mutates the object in db by running the function with existing object as parameter.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close