(batch-in-atom atom path add-map del-vec)
perform batch add and remove operations (-> (atom {:a {:b 1 :c 2}}) (batch-in-atom [:a] {:d 3 :e 4} [[:b] [:c]])) => {:a {:d 3, :e 4}}
perform batch add and remove operations (-> (atom {:a {:b 1 :c 2}}) (batch-in-atom [:a] {:d 3 :e 4} [[:b] [:c]])) => {:a {:d 3, :e 4}}
(drop-in-atom atom path)
drops elements in the atom
(-> (atom {:a {:b 1 :c 2}}) (drop-in-atom [:a :b]) deref) => {:a {:c 2}}
drops elements in the atom (-> (atom {:a {:b 1 :c 2}}) (drop-in-atom [:a :b]) deref) => {:a {:c 2}}
(keys-in-atom atom path)
returns keys in the atom
(-> (atom {:a {:b 1 :c 2}}) (keys-in-atom [:a])) => [:b :c]
returns keys in the atom (-> (atom {:a {:b 1 :c 2}}) (keys-in-atom [:a])) => [:b :c]
(match data query)
matches data according to the query
(match 1 odd?) => true
(match {:a 1} {:a odd?}) => true
matches data according to the query (match 1 odd?) => true (match {:a 1} {:a odd?}) => true
(peek-in-atom atom path)
looks at the value in the atom
(-> (atom {:a {:b :c}}) (peek-in-atom [:a])) => {:b :c}
looks at the value in the atom (-> (atom {:a {:b :c}}) (peek-in-atom [:a])) => {:b :c}
(put-in-atom atom path v)
puts a value in the atom
(-> (atom {:a {:b 1}}) (put-in-atom [:a] {:c 2}) deref) => {:a {:b 1 :c 2}}
puts a value in the atom (-> (atom {:a {:b 1}}) (put-in-atom [:a] {:c 2}) deref) => {:a {:b 1 :c 2}}
(select-in-atom atom path q)
selects the necessary data in the data
(-> (atom {:a {:b 1 :c 2}}) (select-in-atom [:a] even?)) => [[:c 2]]
selects the necessary data in the data (-> (atom {:a {:b 1 :c 2}}) (select-in-atom [:a] even?)) => [[:c 2]]
(set-in-atom atom path v)
drops elements in the atom
(-> (atom {:a {:b 1}}) (set-in-atom [:a] {:c 2}) deref) => {:a {:c 2}}
drops elements in the atom (-> (atom {:a {:b 1}}) (set-in-atom [:a] {:c 2}) deref) => {:a {:c 2}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close