Liking cljdoc? Tell your friends :D

clj-toolbox.functools


apply-n-timesclj

(apply-n-times n f x)

Applies function {f} {n} times with a starting value of {x} For example: (apply-n-times 2 inc 0) is equivalent to (inc (inc 0)) (apply-n-times 3 inc 5) is equivalent to (inc (inc (inc 5)))

Applies function {f} {n} times with a starting value of {x}
For example:
 (apply-n-times 2 inc 0) is equivalent to (inc (inc 0))
 (apply-n-times 3 inc 5) is equivalent to (inc (inc (inc 5)))
sourceraw docstring

cache-most-recent-retclj

(cache-most-recent-ret a f)

Returns a fn that when called, passes the args to f and caches the return value in the atom a

Returns a fn that when called, passes the args to f and caches the return value in the atom a
sourceraw docstring

ignore-argsclj

(ignore-args f)

Takes a zero-arity function and wraps it to take any args and ignore them

Takes a zero-arity function and wraps it to take any args and ignore them
sourceraw docstring

loop-in-background-thread!clj

(loop-in-background-thread! f sleep-seconds)
(loop-in-background-thread! f sleep-seconds sleep-millis)
source

map-paginatedclj

(map-paginated f
               &
               {:keys [get-token get-vals]
                :or {get-token identity get-vals identity}})

Maps a function of one argument continuously

This is intended to be used with api calls that are paginated to get the full list of results.

Args: f - function of one argument, either nil or a value to be used as a continuation token :get-token - extract the next continuation token from the return value of (f token) :get-vals - extract the values to be returned from the return value of (f token)

Maps a function of one argument continuously

This is intended to be used with api calls that
are paginated to get the full list of results.

Args:
 f - function of one argument, either nil or a value to be used as a continuation token
 :get-token - extract the next continuation token from the return value of (f token)
 :get-vals - extract the values to be returned from the return value of (f token)
sourceraw docstring

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

× close