Liking cljdoc? Tell your friends :D
ClojureScript only.

taoensso.encore

Some tools I use often, w/o any external deps.

Some tools I use often, w/o any external deps.
raw docstring

*log-level*cljs

DEPRECATED

DEPRECATED
raw docstring

->?singletoncljs

(->?singleton coll)

->veccljs

(->vec x)

abscljs

(abs n)

ajax-litecljs

(ajax-lite uri
           {:keys [method params headers timeout-ms resp-type with-credentials?
                   progress-fn errorf]
            :as opts
            :or {method :get timeout-ms 10000 resp-type :auto errorf logf}}
           callback)

Alpha - subject to change. Simple+lightweight Ajax via Google Closure. Returns nil, or the xhr instance. Ref. https://developers.google.com/closure/library/docs/xhrio.

(ajax-lite "/my-post-route" {:method :post :params {:username "Rich Hickey" :type "Awesome"} :headers {"Foo" "Bar"} :resp-type :text :timeout-ms 7000 :with-credentials? false ; Enable if using CORS (requires xhr v2+) } (fn async-callback [resp-map] (let [{:keys [success? ?status ?error ?content ?content-type]} resp-map] ;; ?status - 200, 404, ..., or nil on no response ;; ?error - e/o #{:xhr-pool-depleted :exception :http-error :abort ;; :timeout :no-content <http-error-status> nil} (js/alert (str "Ajax response: " resp-map)))))

Alpha - subject to change.
Simple+lightweight Ajax via Google Closure. Returns nil, or the xhr instance.
Ref. https://developers.google.com/closure/library/docs/xhrio.

(ajax-lite "/my-post-route"
  {:method     :post
   :params     {:username "Rich Hickey"
                :type     "Awesome"}
   :headers    {"Foo" "Bar"}
   :resp-type  :text
   :timeout-ms 7000
   :with-credentials? false ; Enable if using CORS (requires xhr v2+)
  }
  (fn async-callback [resp-map]
    (let [{:keys [success? ?status ?error ?content ?content-type]} resp-map]
      ;; ?status  - 200, 404, ..., or nil on no response
      ;; ?error   - e/o #{:xhr-pool-depleted :exception :http-error :abort
      ;;                  :timeout :no-content <http-error-status> nil}
      (js/alert (str "Ajax response: " resp-map)))))
raw docstring

as-?boolcljs

(as-?bool x)

as-?floatcljs

(as-?float x)

as-?intcljs

(as-?int x)

as-?kwcljs

(as-?kw x)

as-?namecljs

(as-?name x)

as-?nblankcljs

(as-?nblank x)

as-boolcljs

(as-bool x)

as-floatcljs

(as-float x)

as-intcljs

(as-int x)

as-mapcljs

(as-map kvs & [kf vf])

Cross between hash-map & map-kvs.

Cross between `hash-map` & `map-kvs`.
raw docstring

assert-min-encore-versioncljs

(assert-min-encore-version min-version)

assertion-errorcljs

(assertion-error msg)

assoc-somecljs

(assoc-some m & kvs)

Assocs each kv iff its value is not nil.

Assocs each kv iff its value is not nil.
raw docstring

assoc-whencljs

(assoc-when m & kvs)

Assocs each kv iff its val is truthy.

Assocs each kv iff its val is truthy.
raw docstring

atom?cljs

(atom? x)

backport-run!cljs

(backport-run! proc coll)

run! from Clojure 1.7+

`run!` from Clojure 1.7+
raw docstring

benchcljsmacro

(bench nlaps bench*-opts & body)

case-evalcljsmacro

(case-eval e & clauses)

Like case but evaluates test constants for their compile-time value.

Like `case` but evaluates test constants for their compile-time value.
raw docstring

catch-errorscljsmacro

(catch-errors & body)

Experimental. Returns [<?result> <?error>].

Experimental. Returns [<?result> <?error>].
raw docstring

caught-error-datacljsmacro

(caught-error-data & body)

Handy for error-throwing unit tests.

Handy for error-throwing unit tests.
raw docstring

chan?cljs

(chan? x)

check-allcljsmacro

(check-all test)
(check-all test & more)

Experimental. Returns all logical false/throwing expressions (ids/forms), or nil.

Experimental. Returns all logical false/throwing expressions (ids/forms), or nil.
raw docstring

check-somecljsmacro

(check-some test)
(check-some test & more)

Experimental. Returns first logical false/throwing expression (id/form), or nil.

Experimental. Returns first logical false/throwing expression (id/form), or nil.
raw docstring

clampcljs

(clamp nmin nmax n)

clamp*cljsmacro

(clamp* nmin nmax n)

clj1098cljs

(clj1098 x)

Workaround for Clojure versions [1.4, 1.5) that blow up on reduce-kvs against a nil coll, Ref. http://dev.clojure.org/jira/browse/CLJ-1098.

Workaround for Clojure versions [1.4, 1.5) that blow up on `reduce-kv`s
against a nil coll, Ref. http://dev.clojure.org/jira/browse/CLJ-1098.
raw docstring

compile-ifcljsmacro

(compile-if test then & [?else])

Evaluates test. If it doesn't error and returns logical true, expands to then, otherwise expands to else. Stolen from clojure.core.reducers. (compile-if (Class/forName "java.util.concurrent.ForkJoinTask") (do-cool-stuff-with-fork-join) (fall-back-to-executor-services))

Evaluates `test`. If it doesn't error and returns logical true, expands to
`then`, otherwise expands to `else`. Stolen from `clojure.core.reducers`.
(compile-if (Class/forName "java.util.concurrent.ForkJoinTask")
  (do-cool-stuff-with-fork-join)
  (fall-back-to-executor-services))
raw docstring

cond!cljsmacro

(cond! & clauses)

Like cond but throws on no-match like case, condp.

Like `cond` but throws on no-match like `case`, `condp`.
raw docstring

cond-throwcljsmacro

(cond-throw & args)

conj-somecljs

(conj-some coll ?x)
(conj-some coll ?x & ?xs)

contains-in?cljs

(contains-in? coll ks)

count-wordscljs

(count-words s)

debugfcljs

(debugf fmt & xs)

declare-remotecljsmacro

(declare-remote & names)

Declares the given ns-qualified names, preserving symbol metadata. Useful for circular dependencies.

Declares the given ns-qualified names, preserving symbol metadata. Useful for
circular dependencies.
raw docstring

defaliascljsmacro

(defalias target)
(defalias name target)
(defalias name target doc)

Defines an alias for a var, preserving metadata. Adapted from clojure.contrib/def.clj, Ref. http://goo.gl/xpjeH

Defines an alias for a var, preserving metadata. Adapted from
clojure.contrib/def.clj, Ref. http://goo.gl/xpjeH
raw docstring

defonce*cljsmacro

(defonce* name expr)

Like clojure.core/defonce but supports optional docstring and attributes map for name symbol.

Like `clojure.core/defonce` but supports optional docstring and attributes
map for name symbol.
raw docstring

dissoc-incljs

(dissoc-in m ks & dissoc-ks)

distinct-bycljs

(distinct-by keyfn coll)

Like sort-by for distinct. Based on clojure.core/distinct.

Like `sort-by` for distinct. Based on clojure.core/distinct.
raw docstring

distinct-elements?cljs

(distinct-elements? x)

distinctvcljs

(distinctv coll)
(distinctv keyfn coll)

Prefer set when order doesn't matter (much faster).

Prefer `set` when order doesn't matter (much faster).
raw docstring

doto-condcljsmacro

(doto-cond [name x] & clauses)

Diabolical cross between doto, cond-> and as->.

Diabolical cross between `doto`, `cond->` and `as->`.
raw docstring

encore-versioncljs

Used for lib-consumer version assertions

Used for lib-consumer version assertions
raw docstring

error-datacljs

(error-data x)

Returns data map iff x is an error of any type on platform.

Returns data map iff `x` is an error of any type on platform.
raw docstring

error?cljs

(error? x)

errorfcljs

(errorf fmt & xs)

exp-backoffcljs

(exp-backoff nattempt
             &
             [{:keys [factor] min' :min max' :max :or {factor 1000}}])

Returns binary exponential backoff value.

Returns binary exponential backoff value.
raw docstring

explode-keywordcljs

(explode-keyword k)

fatalfcljs

(fatalf fmt & xs)

filter-keyscljs

(filter-keys pred m)

filter-kvscljs

(filter-kvs predk predv m)

filter-valscljs

(filter-vals pred m)

formatcljs

(format fmt & args)

Like clojure.core/format but:

  • Returns "" when fmt is nil rather than throwing an NPE.
  • Formats nil as "nil" rather than "null".
  • Provides ClojureScript support via goog.string.format (this has fewer formatting options than Clojure's format!).
Like `clojure.core/format` but:
* Returns "" when fmt is nil rather than throwing an NPE.
* Formats nil as "nil" rather than "null".
* Provides ClojureScript support via goog.string.format (this has fewer
  formatting options than Clojure's `format`!).
raw docstring

format*cljs

(format* fmt args)

format-query-stringcljs

(format-query-string m)

fq-namecljs

(fq-name x)

Like name but fully qualified: includes namespace in string when present.

Like `name` but fully qualified: includes namespace in string when present.
raw docstring

fzipmapcljs

(fzipmap ks vs)

Faster zipmap using transients.

Faster `zipmap` using transients.
raw docstring

gc-now?cljs

(gc-now?)

get-window-locationcljs

(get-window-location)

Returns browser window's current location. Forgeable.

Returns browser window's current location. Forgeable.
raw docstring

greatestcljs

(greatest coll & [?comparator])

Returns the 'greatest' element in coll in O(n) time.

Returns the 'greatest' element in coll in O(n) time.
raw docstring

havecljsmacro

(have (:!) x)
(have (:!) pred (:in) x)
(have (:!) pred (:in) x & more-xs)

EXPERIMENTAL. Takes a pred and one or more xs. Tests pred against each x, trapping errors. If any pred test fails, throws a detailed error. Otherwise returns input x/xs for convenient inline-use/binding.

Options:

  • By default throws AssertionErrors subject to *assert* value (useful for catching errors during dev). Use a :! first arg to instead throw RuntimeExceptions irrespective of *assert* value (useful for important conditions in production).
  • Use an :in arg after pred to treat x/xs as evaluated coll/colls.
  • See hpred for various convenient pred modifier forms.

Provides a small, simple, deeply flexible alternative to heavier tools like core.typed, Prismatic/schema.

(fn square [x] (let [x (have integer? x)] (* x x))) (fn mult [x y] (let [[x y] (have integer? x y)] (* x y))) (fn mult-many [& xs] (reduce * (have :! [:or integer? float?] :in xs)))

EXPERIMENTAL. Takes a pred and one or more xs. Tests pred against each x,
trapping errors. If any pred test fails, throws a detailed error. Otherwise
returns input x/xs for convenient inline-use/binding.

Options:
  * By default throws `AssertionError`s subject to `*assert*` value (useful
    for catching errors during dev). Use a `:!` first arg to instead throw
    `RuntimeException`s irrespective of `*assert*` value (useful for important
    conditions in production).
  * Use an `:in` arg after pred to treat x/xs as evaluated coll/colls.
  * See `hpred` for various convenient pred modifier forms.

Provides a small, simple, deeply flexible alternative to heavier tools like
core.typed, Prismatic/schema.

  (fn square    [x]    (let [x     (have integer? x)]   (* x x)))
  (fn mult      [x y]  (let [[x y] (have integer? x y)] (* x y)))
  (fn mult-many [& xs] (reduce * (have :! [:or integer? float?] :in xs)))
raw docstring

have!cljsmacro

(have! & args)

have!?cljsmacro

(have!? & args)

have-incljsmacro

(have-in a1 & an)

have-in!cljsmacro

(have-in! & args)

have?cljsmacro

(have? (:!) x)
(have? (:!) pred (:in) x)
(have? (:!) pred (:in) x & more-xs)

EXPERIMENTAL. Like have but returns true rather than input on success (convenient for use in :pre/:post conds).

NB Be cautious using :! tests in :pre/:post conds since :pre/:post conds are themselves subject to *assert* val.

(fn square [x] {:pre [(have? integer? x)]} (* x x)) (fn mult [x y] {:pre [(have? integer? x y)]} (* x y))

EXPERIMENTAL. Like `have` but returns true rather than input on success
(convenient for use in :pre/:post conds).

**NB** Be cautious using `:!` tests in :pre/:post conds since :pre/:post conds
are themselves subject to `*assert*` val.

  (fn square  [x]   {:pre [(have? integer? x)]}   (* x x))
  (fn mult    [x y] {:pre [(have? integer? x y)]} (* x y))
raw docstring

hcondcljs

(hcond hard? ns-str line x_ x-form pred pred-form)

Implementation detail.

Implementation detail.
raw docstring

hpredcljs

(hpred pred-form)

Implementation detail.

Implementation detail.
raw docstring

hthrowcljs

(hthrow hard? ns-str ?line form val & [?err])

Implementation detail.

Implementation detail.
raw docstring

if-cljscljsmacro

(if-cljs then else)

Executes then clause iff generating ClojureScript code. Useful for writing macros that can produce different Clj/Cljs code (this isn't something Cljx currently provides support for). Stolen from Prismatic code, Ref. http://goo.gl/DhhhSN, http://goo.gl/Bhdyna.

Executes `then` clause iff generating ClojureScript code.
Useful for writing macros that can produce different Clj/Cljs code (this isn't
something Cljx currently provides support for). Stolen from Prismatic code,
Ref. http://goo.gl/DhhhSN, http://goo.gl/Bhdyna.
raw docstring

if-letscljsmacro

(if-lets bindings then)
(if-lets bindings then else)

Like if-let but binds multiple values iff all tests are true.

Like `if-let` but binds multiple values iff all tests are true.
raw docstring

infofcljs

(infof fmt & xs)

interleave-allcljs

(interleave-all)
(interleave-all c1)
(interleave-all c1 c2)
(interleave-all c1 c2 & colls)

Greedy version of interleave, Ref. http://goo.gl/KvzqWb.

Greedy version of `interleave`, Ref. http://goo.gl/KvzqWb.
raw docstring

into-allcljs

(into-all to from)
(into-all to from & more)

Like into but supports multiple "from"s.

Like `into` but supports multiple "from"s.
raw docstring

join-oncecljs

(join-once separator & coll)

Like clojure.string/join but ensures no double separators.

Like `clojure.string/join` but ensures no double separators.
raw docstring

keys<=cljs

(keys<= m ks)

keys=cljs

(keys= m ks)

keys=nnil?cljs

(keys=nnil? m ks)

keys>=cljs

(keys>= m ks)

keywordize-mapcljs

(keywordize-map m)

ks-nnil?cljs

(ks-nnil? ks m)

ks<=cljs

(ks<= ks m)

ks=cljs

(ks= ks m)

ks>=cljs

(ks>= ks m)

kw-identical?cljs


leastcljs

(least coll & [?comparator])

Returns the 'least' element in coll in O(n) time.

Returns the 'least' element in coll in O(n) time.
raw docstring

logcljs

(log & xs)

logfcljs

(logf fmt & xs)

logging-levelcljs


logpcljs

(logp & xs)

map-keyscljs

(map-keys f m)

map-kvscljs

(map-kvs kf vf m)

map-valscljs

(map-vals f m)

mapplycljs

(mapply f & args)

Like apply but assumes last arg is a map whose elements should be applied to f as an unpaired seq: (mapply (fn [x & {:keys [y z]}] (str x y z)) 1 {:y 2 :z 3}) where fn will receive args as: (1 :y 2 :z 3).

Like `apply` but assumes last arg is a map whose elements should be applied
to `f` as an unpaired seq:
  (mapply (fn [x & {:keys [y z]}] (str x y z)) 1 {:y 2 :z 3})
    where fn will receive args as: `(1 :y 2 :z 3)`.
raw docstring

max*cljsmacro

(max* n1 n2)

memoize*cljs

(memoize* f)
(memoize* ttl-ms f)
(memoize* cache-size ttl-ms f)

Like clojure.core/memoize but:

  • Uses delays to prevent race conditions on writes.
  • Supports auto invalidation & gc with ttl-ms option.
  • Supports manual invalidation by prepending args with :mem/del or :mem/fresh.
  • Supports cache size limit & gc with cache-size option.
Like `clojure.core/memoize` but:
* Uses delays to prevent race conditions on writes.
* Supports auto invalidation & gc with `ttl-ms` option.
* Supports manual invalidation by prepending args with `:mem/del` or `:mem/fresh`.
* Supports cache size limit & gc with `cache-size` option.
raw docstring

memoize-1cljs


memoize1cljs

(memoize1 f)

Great for Reactjs render op caching on mobile devices, etc.

Great for Reactjs render op caching on mobile devices, etc.
raw docstring

memoize_cljs

(memoize_ f)

As clojure.core/memoize but uses delays to avoid write races.

As `clojure.core/memoize` but uses delays to avoid write races.
raw docstring

memoizedcljs

(memoized cache f & args)

Like (memoize* f) but takes an explicit cache atom (possibly nil) and immediately applies memoized f to given arguments.

Like `(memoize* f)` but takes an explicit cache atom (possibly nil)
and immediately applies memoized f to given arguments.
raw docstring

merge-deepcljs


merge-deep-withcljs


merge-keywordscljs

(merge-keywords ks & [no-slash?])

merge-url-with-query-stringcljs

(merge-url-with-query-string url m)

min*cljsmacro

(min* n1 n2)

mscljs

(ms & {:as opts :keys [years months weeks days hours mins secs msecs ms]})

Returns number of milliseconds in period defined by given args.

Returns number of milliseconds in period defined by given args.
raw docstring

ms->secscljs

(ms->secs ms)

name-with-attrscljs

(name-with-attrs name macro-args)

Handles optional docstrings & attr maps for a macro def's name. Stolen from clojure.tools.macro.

Handles optional docstrings & attr maps for a macro def's name.
Stolen from `clojure.tools.macro`.
raw docstring

nano-timecljs


nblank-str?cljs

(nblank-str? x)

nblank?cljs

(nblank? x)

nested-mergecljs


nested-merge-withcljs

(nested-merge-with f & maps)

nil->strcljs

(nil->str x)

nneg-int?cljs

(nneg-int? x)

nneg-num?cljs

(nneg-num? x)

nneg?cljs

(nneg? x)

nnil-setcljs

(nnil-set x)

nnil=cljs

(nnil= x y)
(nnil= x y & more)

nnil?cljs

(nnil? x)

norm-word-breakscljs

(norm-word-breaks s)

Converts all word breaks of any form and length (including line breaks of any form, tabs, spaces, etc.) to a single regular space.

Converts all word breaks of any form and length (including line breaks of any
form, tabs, spaces, etc.) to a single regular space.
raw docstring

now-dtcljs

(now-dt)

now-udtcljs

(now-udt)

now-udt-mock-fncljs

(now-udt-mock-fn & [mock-udts])

Useful for testing.

Useful for testing.
raw docstring

nvec?cljs

(nvec? n x)

parse-boolcljs


parse-floatcljs


parse-intcljs


parse-query-paramscljs

(parse-query-params s & [keywordize? encoding])

Based on ring-codec/form-decode.

Based on `ring-codec/form-decode`.
raw docstring

pathcljs

(path & parts)

Joins string paths (URLs, file paths, etc.) ensuring correct "/" interposition.

Joins string paths (URLs, file paths, etc.) ensuring correct "/"
interposition.
raw docstring

pos-int?cljs

(pos-int? x)

pos-num?cljs

(pos-num? x)

powcljs

(pow n exp)

qbcljsmacro

(qb & args)

qb-min-timescljs

(qb-min-times times)

qbenchcljsmacro

(qbench nlaps form)
(qbench nlaps form & more)

Quick bench. Returns fastest of 3 sets of lap times for each form, in msecs.

Quick bench. Returns fastest of 3 sets of lap times for each form, in msecs.
raw docstring

queuecljs

(queue)
(queue coll)

Returns a PersistentQueue.

Returns a PersistentQueue.
raw docstring

queue*cljs

(queue* & items)

queue?cljs

(queue? x)

rate-limitcljs

(rate-limit specs f)

rate-limitedcljs

(rate-limited ncalls-limit window-ms f)

rate-limitercljs

(rate-limiter ncalls-limit window-ms)

rate-limiter*cljs

(rate-limiter* specs)

Takes one or more rate specs of form [ncalls-limit window-ms ?spec-id] and returns a (fn [& [req-id])) that returns nil (=> all rate limits passed), or [<ms-wait> <worst-offending-spec-id>] / <ms-wait>.

Takes one or more rate specs of form [ncalls-limit window-ms ?spec-id] and
returns a (fn [& [req-id])) that returns `nil` (=> all rate limits passed), or
[<ms-wait> <worst-offending-spec-id>] / <ms-wait>.
raw docstring

rcomparecljs

(rcompare x y)

Reverse comparator.

Reverse comparator.
raw docstring

re-pattern?cljs

(re-pattern? x)

read-edncljs

(read-edn s)

remove-valscljs

(remove-vals pred m)

Smaller, common-case version of filter-vals. Esp useful with nil?/blank? pred when constructing maps: {:foo (when _ <...>) :bar (when _ <...>)} in a way that preservers :or semantics.

Smaller, common-case version of `filter-vals`. Esp useful with `nil?`/`blank?`
pred when constructing maps: {:foo (when _ <...>) :bar (when _ <...>)} in a
way that preservers :or semantics.
raw docstring

removevcljs

(removev pred coll)

repeatedly*cljsmacro

(repeatedly* n & body)

repeatedly-intocljs

(repeatedly-into coll n f)

Like repeatedly but faster and conjs items into given collection.

Like `repeatedly` but faster and `conj`s items into given collection.
raw docstring

repeatedly-into*cljsmacro

(repeatedly-into* coll n & body)

replace-incljs

(replace-in m & ops)

Experimental. For use with swap!, etc.

Experimental. For use with `swap!`, etc.
raw docstring

reportfcljs

(reportf fmt & xs)

reset-in!cljs

(reset-in! atom_ ks new-val)
(reset-in! atom_ ks new-val & more)

Is to reset! as swap-in! is to swap!.

Is to `reset!` as `swap-in!` is to `swap!`.
raw docstring

roundcljs

(round n & [type nplaces])

round*cljs


round1cljs

(round1 n)

Optimized common case.

Optimized common case.
raw docstring

round2cljs

(round2 n)

Optimized common case.

Optimized common case.
raw docstring

sayfcljs

(sayf fmt & xs)

saypcljs

(sayp & xs)

secscljs


secs->mscljs

(secs->ms secs)

seq-kvscljs

(seq {:a :A}) => ([:a :A]) (seq-kvs {:a :A}) => (:a :A)

(seq     {:a :A}) => ([:a :A])
(seq-kvs {:a :A}) => (:a :A)
raw docstring

set*cljs

(set* x)

set-exp-backoff-timeout!cljs

(set-exp-backoff-timeout! nullary-f & [nattempt])

singleton?cljs

(singleton? coll)

spaced-strcljs

(spaced-str xs)

spaced-str-with-nilscljs

(spaced-str-with-nils xs)

str-?indexcljs

(str-?index s substr & [start-idx last?])

str-contains?cljs

(str-contains? s substr)

str-ends-with?cljs

(str-ends-with? s substr)

str-starts-with?cljs

(str-starts-with? s substr)

stringy?cljs

(stringy? x)

sub-indexescljs

(sub-indexes x start-idx & {:keys [max-len end-idx]})

Returns [<inclusive-start-idx*> <exclusive-end-idx*>] for counted 0-indexed input (str, vec, etc.) with support for:

  • Clamping of indexes beyond limits.
  • Max-length -> end-index.
  • -ive indexes (as +ive indexes but work from back of input): (+0) (+1) (+2) (+3) (+4) ; inclusive +ive indexes h e l l o ; 5 count (-5) (-4) (-3) (-2) (-1) ; inclusive -ive indexes
Returns [<inclusive-start-idx*> <exclusive-end-idx*>] for counted 0-indexed
input (str, vec, etc.) with support for:
  * Clamping of indexes beyond limits.
  * Max-length -> end-index.
  * -ive indexes (as +ive indexes but work from back of input):
    (+0) (+1) (+2) (+3) (+4)  ; inclusive +ive indexes
      h    e    l    l    o   ; 5 count
    (-5) (-4) (-3) (-2) (-1)  ; inclusive -ive indexes
raw docstring

substrcljs

(substr s start-idx & [?max-len])

Gives a consistent, flexible, cross-platform substring API built on sub-indexes.

Gives a consistent, flexible, cross-platform substring API built on
`sub-indexes`.
raw docstring

subvec*cljs

(subvec* v start-idx & [?max-len])

Like subvec but uses sub-indexes.

Like `subvec` but uses `sub-indexes`.
raw docstring

swap-in!cljs

(swap-in! atom_ ks f)
(swap-in! atom_ ks f & more)

More powerful version of swap!:

  • Supports optional update-in semantics.
  • Swap fn can return (swapped <new-val> <return-val>) rather than just <new-val>. This is useful when writing atomic pull fns, etc.
More powerful version of `swap!`:
* Supports optional `update-in` semantics.
* Swap fn can return `(swapped <new-val> <return-val>)` rather than just
  <new-val>. This is useful when writing atomic pull fns, etc.
raw docstring

swap-val!cljs

(swap-val! atom_ k f)

Swaps associative value at key and returns the new value. Specialized, fast swap-in! for use mostly by memoization utils.

Swaps associative value at key and returns the new value.
Specialized, fast `swap-in!` for use mostly by memoization utils.
raw docstring

swappedcljs

(swapped new-val return-val)

Swappedcljs


swapped*cljs

(swapped* x)

swapped?cljs

(swapped? x)

takevcljs

(takev n coll)

thread-local-proxycljsmacro

(thread-local-proxy & body)

Thread-safe proxy wrapper, Ref. http://goo.gl/CEBJnQ (instant.clj).

Thread-safe proxy wrapper, Ref. http://goo.gl/CEBJnQ (instant.clj).
raw docstring

time-mscljsmacro

(time-ms & body)

Returns number of milliseconds it takes to execute body.

Returns number of milliseconds it takes to execute body.
raw docstring

time-nscljsmacro

(time-ns & body)

Returns number of nanoseconds it takes to execute body.

Returns number of nanoseconds it takes to execute body.
raw docstring

tracefcljs

(tracef fmt & xs)

udt?cljs


undefined->nilcljs

(undefined->nil x)

url-decodecljs

(url-decode s & [encoding])

Stolen from http://goo.gl/99NSR1.

Stolen from http://goo.gl/99NSR1.
raw docstring

url-encodecljs

(url-encode s)

Stolen from http://goo.gl/99NSR1.

Stolen from http://goo.gl/99NSR1.
raw docstring

uuid-strcljs

(uuid-str)
(uuid-str max-length)

Returns a UUIDv4 string of form "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", Ref. http://www.ietf.org/rfc/rfc4122.txt, https://gist.github.com/franks42/4159427

Returns a UUIDv4 string of form "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
Ref. http://www.ietf.org/rfc/rfc4122.txt,
     https://gist.github.com/franks42/4159427
raw docstring

vec*cljs

(vec* x)

vec2?cljs

(vec2? x)

vec3?cljs

(vec3? x)

vsplit-firstcljs

(vsplit-first v)

warnfcljs

(warnf fmt & xs)

when-letscljsmacro

(when-lets bindings & body)

Like when-let but binds multiple values iff all tests are true.

Like `when-let` but binds multiple values iff all tests are true.
raw docstring

xdistinctcljs

(xdistinct)
(xdistinct keyfn)
(xdistinct keyfn coll)

distinctv` transducer.

distinctv` transducer.
raw docstring

zero-num?cljs

(zero-num? x)

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

× close