Dev-only extension point for dev/x-trace-history. Holds a 1-arg function called on each lifecycle callback (connected, disconnected, attribute-changed). nil by default — each callback site is a single atom-deref + nil check when off.
Dev-only extension point for dev/x-trace-history. Holds a 1-arg function called on each lifecycle callback (connected, disconnected, attribute-changed). nil by default — each callback site is a single atom-deref + nil check when off.
(make-element-class {:keys [observed-attributes connected-fn disconnected-fn
attribute-changed-fn form-associated?
form-disabled-fn form-reset-fn setup-prototype-fn
internal?]})Create a custom element class from a declarative options map.
Required keys: :observed-attributes — #js [...] array of attribute names :connected-fn — (fn [el] ...) called on connectedCallback :attribute-changed-fn — (fn [el name old new] ...) called on attributeChangedCallback
Optional keys: :disconnected-fn — (fn [el] ...) called on disconnectedCallback :form-associated? — true to mark as form-associated element :form-disabled-fn — (fn [el disabled?] ...) called on formDisabledCallback :form-reset-fn — (fn [el] ...) called on formResetCallback :setup-prototype-fn — (fn [proto] ...) install properties/methods on prototype :internal? — when true, skip firing the dev-tool lifecycle hook on every callback. Set this on elements that are themselves part of the dev tooling (e.g. the x-trace-history dock); otherwise their own connect/disconnect/attribute records would pollute the trace they produce.
Create a custom element class from a declarative options map.
Required keys:
:observed-attributes — #js [...] array of attribute names
:connected-fn — (fn [el] ...) called on connectedCallback
:attribute-changed-fn — (fn [el name old new] ...) called on attributeChangedCallback
Optional keys:
:disconnected-fn — (fn [el] ...) called on disconnectedCallback
:form-associated? — true to mark as form-associated element
:form-disabled-fn — (fn [el disabled?] ...) called on formDisabledCallback
:form-reset-fn — (fn [el] ...) called on formResetCallback
:setup-prototype-fn — (fn [proto] ...) install properties/methods on prototype
:internal? — when true, skip firing the dev-tool lifecycle hook
on every callback. Set this on elements that are
themselves part of the dev tooling (e.g. the
x-trace-history dock); otherwise their own
connect/disconnect/attribute records would
pollute the trace they produce.(register! tag-name class-opts)Register a custom element if not already defined.
Register a custom element if not already defined.
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 |