Liking cljdoc? Tell your friends :D

hara.event.common


add-handlerclj

(add-handler manager handler)
(add-handler manager checker handler)

adds a handler to the manager (-> (add-handler (manager) :hello {:id :hello :handler identity}) (match-handlers {:hello "world"}) (count)) => 1

adds a handler to the manager
(-> (add-handler (manager) :hello {:id :hello
                                   :handler identity})
    (match-handlers {:hello "world"})
    (count))
=> 1
raw docstring

check-dataclj

(check-data data chk)

checks to see if the data corresponds to a template

(check-data {:hello true} :hello) => true

(check-data {:hello true} {:hello true?}) => true

(check-data {:hello true} '_) => true

(check-data {:hello true} #{:hello}) => true

checks to see if the data corresponds to a template

(check-data {:hello true} :hello)
=> true

(check-data {:hello true} {:hello true?})
=> true

(check-data {:hello true} '_)
=> true

(check-data {:hello true} #{:hello})
=> true
raw docstring

checker-formclj

(checker-form checker)

creates a checker form

(checker-form '_) => hara.common.primitives/T

(checker-form 'string?) => 'string?

creates a checker form

(checker-form '_) => hara.common.primitives/T

(checker-form 'string?) => 'string?
raw docstring

expand-dataclj

(expand-data data)

expands shorthand data into a map

(expand-data :hello) => {:hello true}

(expand-data [:hello {:world "foo"}]) => {:world "foo", :hello true}

expands shorthand data into a map

(expand-data :hello)
=> {:hello true}

(expand-data [:hello {:world "foo"}])
=> {:world "foo", :hello true}
raw docstring

handler-formclj

(handler-form bindings body)

creates a bindings form based on input

(handler-form '[name date] '(str name " " date)) => '(clojure.core/fn [{:keys [name date]}] str name " " date)

creates a bindings form based on input

(handler-form '[name date]
              '(str name " " date))
=> '(clojure.core/fn [{:keys [name date]}] str name " " date)
raw docstring

list-handlersclj

(list-handlers manager)
(list-handlers manager checker)

list handlers that are present for a given manager

(list-handlers (manager)) => []

list handlers that are present for a given manager

(list-handlers (manager))
=> []
raw docstring

managerclj

(manager)
(manager id store options)

creates a new manager (manager) ;; => #hara.event.common.Manager{:id :b56eb2c9-8d21-4680-b3e1-0023ae685d2b, ;; :store [], :options {}}

creates a new manager
(manager)
;; => #hara.event.common.Manager{:id :b56eb2c9-8d21-4680-b3e1-0023ae685d2b,
;;                               :store [], :options {}}
raw docstring

match-handlersclj

(match-handlers manager data)

match handlers for a given manager

(-> (add-handler (manager) :hello {:id :hello :handler identity}) (match-handlers {:hello "world"})) => (contains-in [{:id :hello :handler fn? :checker :hello}])

match handlers for a given manager

(-> (add-handler (manager) :hello {:id :hello
                                   :handler identity})
    (match-handlers {:hello "world"}))
=> (contains-in [{:id :hello
                  :handler fn?
                  :checker :hello}])
raw docstring

new-idclj

(new-id)

creates a random id with a keyword base (new-id) ;;=> :06679506-1f87-4be8-8cfb-c48f8579bc00

creates a random id with a keyword base
(new-id)
;;=> :06679506-1f87-4be8-8cfb-c48f8579bc00
raw docstring

remove-handlerclj

(remove-handler manager id)

adds a handler to the manager (-> (add-handler (manager) :hello {:id :hello :handler identity}) (remove-handler :hello) (match-handlers {:hello "world"})) => ()

adds a handler to the manager
(-> (add-handler (manager) :hello {:id :hello
                                   :handler identity})
    (remove-handler :hello)
    (match-handlers {:hello "world"}))
=> ()
raw docstring

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

× close