Liking cljdoc? Tell your friends :D

std.dom.component


+init+clj


+mixin-keys+clj


child-componentsclj

(child-components dom)

collects child components of component tree

collects child components of component tree
raw docstring

component-installclj

(component-install tag class template {:keys [mixins] :as meta})

installs component given template and mixins

installs component given template and mixins
raw docstring

component-optionsclj

(component-options template mixins)
(component-options template mixins ks)

prepare component options given template and mixin maps

(component-options (fn [dom props] (base/dom-compile [:mock/label "hello"])) [{:pre-render (fn [dom] dom)} {:post-render (fn [dom] dom)}]) => (contains {:pre-render fn? :post-render fn? :template fn?})

prepare component options given template and mixin maps

(component-options (fn [dom props]
                     (base/dom-compile [:mock/label "hello"]))
                   [{:pre-render (fn [dom] dom)}
                    {:post-render (fn [dom] dom)}])
=> (contains {:pre-render fn?
              :post-render fn?
              :template fn?})
raw docstring

defcompcljmacro

(defcomp tag doc? attr? & [bindings & body])

defines a component

defines a component
raw docstring

dom-apply-componentclj

(dom-apply-component {:keys [tag] :as dom} ops)

applies operations to component dom

applies operations to component dom
raw docstring

dom-component?clj

(dom-component? obj)

checks if dom is that of a component

(dom-component? (base/dom-compile [:mock/pane-static])) => true

checks if dom is that of a component

(dom-component? (base/dom-compile [:mock/pane-static]))
=> true
raw docstring

dom-ops-componentclj

(dom-ops-component tag props-old props-new)

constructs transform operations for component dom

constructs transform operations for component dom
raw docstring

dom-remove-componentclj

(dom-remove-component {:keys [tag] :as dom})

removes rendered component from dom

removes rendered component from dom
raw docstring

dom-render-componentclj

(dom-render-component {:keys [tag props] :as dom})

component dom element rendering function

(-> (base/dom-compile [:mock/pane-static [:mock/box-static {:title "a" :content "A"}] [:mock/box-static {:title "b" :content "B"}]]) (dom-render-component) (base/dom-format)) => [:+ :mock/pane-static [:+ :mock/box-static {:title "a", :content "A"}] [:+ :mock/box-static {:title "b", :content "B"}]]

component dom element rendering function

(-> (base/dom-compile [:mock/pane-static
                       [:mock/box-static {:title "a" :content "A"}]
                       [:mock/box-static {:title "b" :content "B"}]])
    (dom-render-component)
    (base/dom-format))
=> [:+ :mock/pane-static
    [:+ :mock/box-static {:title "a", :content "A"}]
    [:+ :mock/box-static {:title "b", :content "B"}]]
raw docstring

dom-replace-componentclj

(dom-replace-component {:keys [tag] :as dom} new-dom)

default replace operation for components

default replace operation for components
raw docstring

dom-state-handlerclj

(dom-state-handler
  _
  {:keys [cursor state new transform] :as event :or {transform identity}})

updates the state with given value

(dom-state-handler nil {:state (atom {}) :cursor [:data] :new "hello" :transform keyword}) => {:data :hello}

updates the state with given value

(dom-state-handler nil {:state (atom {})
                        :cursor [:data]
                        :new "hello"
                        :transform keyword})
=> {:data :hello}
raw docstring

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

× close