(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}
(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]]
(dom-send-local dom)
sends events that are in :local/events
sends events that are in :local/events
(dom-set-local dom {:keys [id new key cursor transform mute] :as m})
function for setting local dom
function for setting local dom
(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
(local-dom-state dom)
returns the local dom state
returns the local dom state
(local-parent dom)
returns the local dom parent
returns the local dom parent
(local-parent-state dom)
returns the local dom parent state
returns the local dom parent state
(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}
(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}]
(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?
(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))
(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?
(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?
(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?
(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?
(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) => {}
(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})
(localized-watch dom props)
sets up the initial watch and triggers
sets up the initial watch and triggers
(localized-wrap-template template-fn)
localized wrapper function for :template
localized wrapper function for :template
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close