(register! {:keys [tag child-tag render on-failure on-pending on-connect
on-writing observed-attributes render-key]})Register a resource-consumer custom element from a config:
:tag element tag name
:child-tag the driven child element, cached on connect
:render (fn [child view this]), optional, called when the render-key slice changes.
view is the whole of what a consumer may read: {:accepted :failure :intent
:pending? :writing?}.
:on-failure (fn [child failure this]), optional, called when :failure changes,
with failure nil on recovery so the component can clear its UI
:on-pending (fn [child pending this]), optional, called when :pending? changes
:on-writing (fn [child writing this]), optional, called when :writing? changes
:on-connect (fn [this]), optional extra wiring
:render-key (fn [view]) -> the slice render draws, so render only fires when it changes.
Defaults to the accepted envelope
:observed-attributes — optional, defaults to #js []
Register a resource-consumer custom element from a config:
:tag element tag name
:child-tag the driven child element, cached on connect
:render (fn [child view this]), optional, called when the render-key slice changes.
`view` is the whole of what a consumer may read: {:accepted :failure :intent
:pending? :writing?}.
:on-failure (fn [child failure this]), optional, called when :failure changes,
with failure nil on recovery so the component can clear its UI
:on-pending (fn [child pending this]), optional, called when :pending? changes
:on-writing (fn [child writing this]), optional, called when :writing? changes
:on-connect (fn [this]), optional extra wiring
:render-key (fn [view]) -> the slice render draws, so render only fires when it changes.
Defaults to the accepted envelope
:observed-attributes — optional, defaults to #js [](submit-intent! consumer patch)(submit-intent! consumer patch target-id)Send an intent patch from a gesture handler back to a server-resource. With no target-id
the patch drives the consumer's own resource. With one, it drives the named sibling resource
through its URL projection. This is explicit, URL-mediated cross-resource coordination.
Send an intent patch from a gesture handler back to a server-resource. With no `target-id` the patch drives the consumer's own resource. With one, it drives the named sibling resource through its URL projection. This is explicit, URL-mediated cross-resource coordination.
(submit-write! consumer payload)Send a write from a gesture handler back to the server-resource.
Send a write from a gesture handler back to the server-resource.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |