Liking cljdoc? Tell your friends :D

std.dom.update


dom-applycljmultimethod

applies operations to the dom (-> (base/dom-create :mock/pane {:a 1}) (impl/dom-render) (dom-apply [[:set :b 2 nil] [:delete :a 1]]) (base/dom-item) :props) => {:b 2}

applies operations to the dom
(-> (base/dom-create :mock/pane {:a 1})
    (impl/dom-render)
    (dom-apply [[:set :b 2 nil]
                [:delete :a 1]])
    (base/dom-item)
    :props)
=> {:b 2}
raw docstring

dom-apply-defaultclj

(dom-apply-default dom ops)

default function for dom-apply

(-> (dom-apply-default (doto (base/dom-compile [:mock/pane {:items ["a"]}]) (impl/dom-render)) [[:update :items [[:list-set 0 "A"]]]]) (base/dom-item) (mock/mock-format)) => [:mock/pane {:items ["A"]}]

default function for dom-apply

(-> (dom-apply-default (doto (base/dom-compile [:mock/pane {:items ["a"]}])
                         (impl/dom-render))
                       [[:update :items [[:list-set 0 "A"]]]])
    (base/dom-item)
    (mock/mock-format))
=> [:mock/pane {:items ["A"]}]
raw docstring

dom-refreshclj

(dom-refresh dom)

refreshes current dom, used for components

(-> (base/dom-compile [:mock/pane {:b 2}]) (impl/dom-render) (dom-refresh) str read-string) => [:+ :mock/pane {:b 2}]

refreshes current dom, used for components

(-> (base/dom-compile [:mock/pane {:b 2}])
    (impl/dom-render)
    (dom-refresh)
    str read-string)
=> [:+ :mock/pane {:b 2}]
raw docstring

dom-updateclj

(dom-update dom new-dom)

updates current dom given new dom

(-> (doto (base/dom-compile [:mock/pane {:a 1} [:mock/pane {:b 2}] [:mock/pane {:c 3}]]) (impl/dom-render) (dom-update (base/dom-compile [:mock/pane {:a 1} [:mock/pane {:b 2}] [:mock/pane {:c 4}]]))) (base/dom-item) str read-string) => [:mock/pane {:a 1} [:mock/pane {:b 2}] [:mock/pane {:c 4}]]

updates current dom given new dom

(-> (doto (base/dom-compile [:mock/pane {:a 1}
                             [:mock/pane {:b 2}]
                             [:mock/pane {:c 3}]])
      (impl/dom-render)
      (dom-update (base/dom-compile [:mock/pane {:a 1}
                                     [:mock/pane {:b 2}]
                                     [:mock/pane {:c 4}]])))
    (base/dom-item)
    str read-string)
=> [:mock/pane {:a 1} [:mock/pane {:b 2}] [:mock/pane {:c 4}]]
raw docstring

update-listclj

(update-list dom k list ops)

updates a list within props

(update-list (impl/dom-render (base/dom-compile [:mock/pane "a"])) :items ["a"] [[:list-set 0 "A" "a"]]) => ["A"]

updates a list within props

(update-list (impl/dom-render (base/dom-compile [:mock/pane "a"]))
             :items
             ["a"]
             [[:list-set 0 "A" "a"]])
=> ["A"]
raw docstring

update-list-appendclj

(update-list-append list [_ new])

updates :append changes to list

(update-list-append ["A"] [:list-append "B"]) => ["A" "B"]

updates :append changes to list

(update-list-append ["A"]
                    [:list-append "B"])
=> ["A" "B"]
raw docstring

update-list-dropclj

(update-list-drop list [_ old])

updates :drop changes to list

(update-list-drop ["A" "B"] [:list-drop "B"]) => ["A"]

updates :drop changes to list

(update-list-drop ["A" "B"]
                  [:list-drop "B"])
=> ["A"]
raw docstring

update-list-insertclj

(update-list-insert list [_ i items])

updates the list by inserting values

(update-list-insert [] [:list-insert 0 [1 2 3 4]]) => [1 2 3 4]

updates the list by inserting values

(update-list-insert []
                    [:list-insert 0 [1 2 3 4]])
=> [1 2 3 4]
raw docstring

update-list-removeclj

(update-list-remove list [_ i number])

updates the list by deleting values

(update-list-remove [1 2 3 4] [:list-remove 1 2]) => [1 4]

updates the list by deleting values

(update-list-remove [1 2 3 4]
                    [:list-remove 1 2])
=> [1 4]
raw docstring

update-list-updateclj

(update-list-update list [_ k ops])

updates :update changes to list

(update-list-update [(-> (base/dom-compile [:mock/label]) (impl/dom-render))] [:update 0 [[:set :text "hello"]]]) => (contains [#(= "hello" (:text (:props %)))])

updates :update changes to list

(update-list-update [(-> (base/dom-compile [:mock/label])
                         (impl/dom-render))]
                    [:update 0 [[:set :text "hello"]]])
=> (contains [#(= "hello" (:text (:props %)))])
raw docstring

update-propsclj

(update-props dom props ops)

updates props of doms

(update-props (base/dom-compile [:mock/label]) {} [[:set :text "hello"]]) => {:text "hello"}

updates props of doms

(update-props (base/dom-compile [:mock/label]) {} [[:set :text "hello"]])
=> {:text "hello"}
raw docstring

update-props-deleteclj

(update-props-delete props [_ k old])

updates props given an operation

(update-props-delete {:text "hello"} [:delete :text "hello"]) => {}

updates props given an operation

(update-props-delete {:text "hello"}
                     [:delete :text "hello"])
=> {}
raw docstring

update-props-updateclj

(update-props-update dom props [_ k ops :as op])

updates :update changes to props

(update-props-update (doto (base/dom-compile [:mock/pane]) impl/dom-render) {:items ["A"]} [:update :items [[:list-set 0 "B"]]]) => {:items ["B"]}

updates :update changes to props

(update-props-update (doto (base/dom-compile [:mock/pane]) impl/dom-render)
                     {:items ["A"]}
                     [:update :items [[:list-set 0 "B"]]])
=> {:items ["B"]}
raw docstring

update-setclj

(update-set props [_ k new old])

sets props given a transform

(update-set {} [:set :a 1]) => {:a 1}

(update-set {} [:set :a (base/dom-compile [:mock/label "hello"])]) => (contains {:a base/dom?})

sets props given a transform

(update-set {} [:set :a 1])
=> {:a 1}

(update-set {} [:set :a (base/dom-compile [:mock/label "hello"])])
=> (contains {:a base/dom?})
raw docstring

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

× close