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}(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"]}](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}](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}]](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"](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"](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"](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](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](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 %)))])(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"}(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"])
=> {}(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"]}(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?})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 |