Liking cljdoc? Tell your friends :D

tegere.utils

Reusable utilities for TeGere.

Reusable utilities for TeGere.
raw docstring

bindclj

(bind f [val err])

Call f on val if err is nil, otherwise return [nil err] See https://adambard.com/blog/acceptable-error-handling-in-clojure/.

Call f on val if err is nil, otherwise return [nil err]
See https://adambard.com/blog/acceptable-error-handling-in-clojure/.
sourceraw docstring

deep-merge-withclj

(deep-merge-with f & maps)

Like merge-with, but merges maps recursively, applying the given fn only when there's a non-map at a particular level. (deep-merge-with + {:a {:b {:c 1 :d {:x 1 :y 2}} :e 3} :f 4} {:a {:b {:c 2 :d {:z 9} :z 3} :e 100}}) -> {:a {:b {:z 3, :c 3, :d {:z 9, :x 1, :y 2}}, :e 103}, :f 4} Taken from https://clojuredocs.org/clojure.core/merge-with.

Like merge-with, but merges maps recursively, applying the given fn
only when there's a non-map at a particular level.
(deep-merge-with + {:a {:b {:c 1 :d {:x 1 :y 2}} :e 3} :f 4}
                   {:a {:b {:c 2 :d {:z 9} :z 3} :e 100}})
-> {:a {:b {:z 3, :c 3, :d {:z 9, :x 1, :y 2}}, :e 103}, :f 4}
Taken from https://clojuredocs.org/clojure.core/merge-with.
sourceraw docstring

err->>cljmacro

(err->> val & fns)

Thread-last val through all fns, each wrapped in bind. See https://adambard.com/blog/acceptable-error-handling-in-clojure/.

Thread-last val through all fns, each wrapped in bind.
See https://adambard.com/blog/acceptable-error-handling-in-clojure/.
sourceraw docstring

extract-all-scenario-tagsclj

(extract-all-scenario-tags features)
source

justclj

(just x)
source

just-thenclj

(just-then maybe just-fn)
(just-then [val error] just-fn nothing-fn)

Given a maybe ([just nothing]) and a just function that returns a value given the just as input, return that value, or a nothing ([nil error]) if error is truthy.

Given a maybe (`[just nothing]`) and a just function that returns a value given
the `just` as input, return that value, or a nothing (`[nil error]`) if
`error` is truthy.
sourceraw docstring

just-then-escclj

(just-then-esc maybe)
(just-then-esc maybe just-fn)
(just-then-esc [val error] just-fn nothing-fn)
source

maybe-kv-reducerclj

(maybe-kv-reducer f)
source

maybe-reducerclj

(maybe-reducer f)

Takes a reducing function and returns one that short-circuits on an accumulator argument that is a Nothing 2-vec, i.e., a vector with a non-nil second item.

Takes a reducing function and returns one that short-circuits on an accumulator
argument that is a Nothing 2-vec, i.e., a vector with a non-nil second item.
sourceraw docstring

maybes->maybeclj

(maybes->maybe maybes)

Convert a sequence of maybe Xs (2-vecs) to a single maybe sequence of Xs.

Convert a sequence of maybe Xs (2-vecs) to a single maybe sequence of Xs.
sourceraw docstring

nothingclj

(nothing error)
source

nothing-thenclj

(nothing-then maybe nothing-fn)
(nothing-then [val error] nothing-fn then-fn)

Just like just-then except the nothing handler function is the only one required.

Just like just-then except the nothing handler function is the only one required.
sourceraw docstring

pp-strclj

(pp-str x)
source

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

× close