Liking cljdoc? Tell your friends :D

hara.state.group


add-itemclj

(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]
raw docstring

append-itemsclj

(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]
raw docstring

defgroupcljmacro

(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)
raw docstring

defitemcljmacro

(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]
raw docstring

find-itemclj

(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}
raw docstring

groupclj

(group m)

creates a group from a map (group {:tag :hello}) => #(-> % :tag (= :hello))

creates a group from a map
(group {:tag :hello})
=> #(-> % :tag (= :hello))
raw docstring

Groupclj


group?clj

(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
raw docstring

install-itemsclj

(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]
raw docstring

list-itemsclj

(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]
raw docstring

remove-itemclj

(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]
raw docstring

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

× close