Liking cljdoc? Tell your friends :D

std.dom.local


dom-apply-localclj

(dom-apply-local dom {:keys [props]} ops)

applies operations to the dom

(-> (base/dom-create :test/carrot {:color "purple"}) (impl/dom-render) (dom-apply-local (type/metaprops :test/carrot) [[:set :length 100] [:delete :color "purple"]]) (local-dom-state) deref) => {:color "orange", :length 100}

applies operations to the dom

(-> (base/dom-create :test/carrot {:color "purple"})
    (impl/dom-render)
    (dom-apply-local (type/metaprops :test/carrot) [[:set :length 100]
                                                    [:delete :color "purple"]])
    (local-dom-state)
    deref)
=> {:color "orange", :length 100}
raw docstring

dom-ops-localclj

(dom-ops-local props-old props-new)

creates setters for local properties

(dom-ops-local {:a [1 2] :b 1} {:a [1 2 3] :c 1}) => [[:set :a [1 2 3] [1 2]] [:set :c 1 nil] [:delete :b 1]]

creates setters for local properties

(dom-ops-local {:a [1 2] :b 1}
               {:a [1 2 3] :c 1})
=> [[:set :a [1 2 3] [1 2]]
    [:set :c 1 nil]
    [:delete :b 1]]
raw docstring

dom-send-localclj

(dom-send-local dom)

sends events that are in :local/events

sends events that are in :local/events
raw docstring

dom-set-localclj

(dom-set-local dom {:keys [id new key cursor transform mute] :as m})

function for setting local dom

function for setting local dom
raw docstring

localclj

(local key)
(local dom key)

accesses current local state

(binding [base/local-dom (doto (base/dom-create :mock/label) (mut/mutable:set :cache {:local/state (atom {:hello 1})})) react/react (volatile! #{})] (local :hello)) => 1

accesses current local state

(binding [base/*local-dom* (doto (base/dom-create :mock/label)
                             (mut/mutable:set :cache {:local/state (atom {:hello 1})}))
          react/*react* (volatile! #{})]
  (local :hello))
=> 1
raw docstring

local-domclj

(local-dom dom)

returns the local dom

returns the local dom
raw docstring

local-dom-stateclj

(local-dom-state dom)

returns the local dom state

returns the local dom state
raw docstring

local-parentclj

(local-parent dom)

returns the local dom parent

returns the local dom parent
raw docstring

local-parent-stateclj

(local-parent-state dom)

returns the local dom parent state

returns the local dom parent state
raw docstring

local-setclj

(local-set dom set-props del-props)

sets the local

(-> (base/dom-create :test/carrot {:color "purple"}) (impl/dom-render) (local-set {:length 100} {:color "orange"}) (local-dom-state) deref) => {:color "orange", :length 100}

sets the local 

(-> (base/dom-create :test/carrot {:color "purple"})
    (impl/dom-render)
    (local-set {:length 100} {:color "orange"})
    (local-dom-state)
    deref)
=> {:color "orange", :length 100}
raw docstring

local-split-propsclj

(local-split-props {:keys [props trigger]} on-props)

splits props between change events and trigger events

(local-split-props (type/metaprops :test/carrot) {:on/top :trigger :on/color :event}) => [{:on/color :event} {:on/top :trigger}]

splits props between change events and trigger events

(local-split-props (type/metaprops :test/carrot)
                   {:on/top  :trigger
                    :on/color :event})
=> [{:on/color :event} {:on/top :trigger}]
raw docstring

local-trigger-addclj

(local-trigger-add dom k m)

adds a trigger to the local component

(-> (base/dom-create :test/carrot) (impl/dom-render) (local-trigger-add :on/top {:id :event/top})) => base/dom?

adds a trigger to the local component

(-> (base/dom-create :test/carrot)
    (impl/dom-render)
    (local-trigger-add :on/top {:id :event/top}))
=> base/dom?
raw docstring

local-trigger-removeclj

(local-trigger-remove dom k)

removes a trigger from the local component

(-> (base/dom-create :test/carrot) (impl/dom-render) (local-trigger-add :on/top {:id :event/top}) (local-trigger-remove :on/top))

removes a trigger from the local component

(-> (base/dom-create :test/carrot)
    (impl/dom-render)
   (local-trigger-add :on/top {:id :event/top})
    (local-trigger-remove :on/top))
raw docstring

local-watch-addclj

(local-watch-add dom k m)

adds a watch to the local component

(-> (base/dom-create :test/carrot) (impl/dom-render) (local-watch-add :on/color {:id :event/color})) => base/dom?

adds a watch to the local component

(-> (base/dom-create :test/carrot)
    (impl/dom-render)
    (local-watch-add :on/color {:id :event/color}))
=> base/dom?
raw docstring

local-watch-createclj

(local-watch-create dom k m)

creates a watch for local component

(-> (base/dom-create :test/carrot) (impl/dom-render) (local-watch-create :color {:id :event/color})) => fn?

creates a watch for local component

(-> (base/dom-create :test/carrot)
    (impl/dom-render)
    (local-watch-create :color {:id :event/color}))
=> fn?
raw docstring

local-watch-removeclj

(local-watch-remove dom k)

removes a watch from the local component

(-> (base/dom-create :test/carrot) (impl/dom-render) (local-watch-add :on/color {:id :event/color}) (local-watch-remove :on/color)) => base/dom?

removes a watch from the local component

(-> (base/dom-create :test/carrot)
    (impl/dom-render)
    (local-watch-add :on/color {:id :event/color})
    (local-watch-remove :on/color))
=> base/dom?
raw docstring

localizedclj


localized-handlerclj

(localized-handler {:keys [props handle trigger]})

distinct handler for a given component

(localized-handler (type/metaprops :test/carrot)) => fn?

distinct handler for a given component

(localized-handler (type/metaprops :test/carrot))
=> fn?
raw docstring

localized-pre-removeclj

(localized-pre-remove dom)

localized function called on removal

(-> (doto (base/dom-create :mock/label) (localized-pre-render) (localized-pre-remove)) :cache) => {}

localized function called on removal

(-> (doto (base/dom-create :mock/label)
      (localized-pre-render)
      (localized-pre-remove))
    :cache)
=> {}
raw docstring

localized-pre-renderclj

(localized-pre-render {:keys [tag] :as dom})

sets up the local state pre-render

(-> (doto (base/dom-create :mock/label) (localized-pre-render)) :cache) => (contains {:local/state clojure.lang.Atom})

sets up the local state pre-render

(-> (doto (base/dom-create :mock/label)
      (localized-pre-render))
    :cache)
=> (contains {:local/state clojure.lang.Atom})
raw docstring

localized-watchclj

(localized-watch dom props)

sets up the initial watch and triggers

sets up the initial watch and triggers
raw docstring

localized-wrap-templateclj

(localized-wrap-template template-fn)

localized wrapper function for :template

localized wrapper function for :template
raw docstring

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

× close