(add-item {:keys [constructor key] :as group} data)
adds an item to the group (-> (add-item people {:name :chris}) (list-items)) => [:andy :bob :chris]
adds an item to the group (-> (add-item people {:name :chris}) (list-items)) => [:andy :bob :chris]
(append-items {:keys [constructor key items] :as group} data)
appends a set of data to the group (-> (append-items people [{:name :dave} {:name :erin}]) (list-items)) => [:andy :bob :dave :erin]
appends a set of data to the group (-> (append-items people [{:name :dave} {:name :erin}]) (list-items)) => [:andy :bob :dave :erin]
(defgroup name)
(defgroup name m)
creates a group of items (defgroup people {:tag :people :constructor map->Person :items [{:name :andy} {:name :bob}]}) => (comp group? deref)
creates a group of items (defgroup people {:tag :people :constructor map->Person :items [{:name :andy} {:name :bob}]}) => (comp group? deref)
(defitem group data)
adds an item to the group (-> (defitem people {:name :chris}) deref list-items) => [:andy :bob :chris]
adds an item to the group (-> (defitem people {:name :chris}) deref list-items) => [:andy :bob :chris]
(find-item {:keys [items] :as group} tag)
finds an item based on the given key (find-item people :andy) => {:name :andy}
finds an item based on the given key (find-item people :andy) => {:name :andy}
(group m)
creates a group from a map (group {:tag :hello}) => #(-> % :tag (= :hello))
creates a group from a map (group {:tag :hello}) => #(-> % :tag (= :hello))
(group? x)
checks to see if an element is a group (group? people) => true
checks to see if an element is a group (group? people) => true
(install-items group file)
reads a set of data from a resource and loads it into the group (-> (install-items people (java.io.StringReader. "[{:name :dave} {:name :erin}]")) (list-items)) => [:andy :bob :dave :erin]
reads a set of data from a resource and loads it into the group (-> (install-items people (java.io.StringReader. "[{:name :dave} {:name :erin}]")) (list-items)) => [:andy :bob :dave :erin]
(list-items {:keys [items] :as group})
returns a list of keys to items in the group
(list-items people) => [:andy :bob :chris]
returns a list of keys to items in the group (list-items people) => [:andy :bob :chris]
(remove-item group tag)
removes items based on the key (-> (remove-item people :chris) (list-items)) => [:andy :bob]
removes items based on the key (-> (remove-item people :chris) (list-items)) => [:andy :bob]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close