Provides a protocol, and some default implementations, for working with potentially asynchronous chains of execution.
Provides a protocol, and some default implementations, for working with potentially asynchronous chains of execution.
(-chain chainable continue)
Calls continue (eventually) with the resolved value.
Calls continue (eventually) with the resolved value.
(chain x continue)
If x
satisfies Chain
, calls continue
with the
resolved value, once it resolves.
Returns nil
.
If `x` satisfies `Chain`, calls `continue` with the resolved value, once it resolves. Returns `nil`.
(chain-all form & {:keys [mapper]})
Walks the form x
, waiting for anything that satisfies Chain
to resolve.
Returns a chainable, which resolves to x
with all its inner
chainables resolved.
If an inner chainable resolves to an error?
value, the resolved
value will be the first such value encountered instead of the
resolved x
.
If mapper
is given, each inner value of x
will be passed
through it; allowing for substitution. If the value is a
chainable, then the resolved value will be passed.
Walks the form `x`, waiting for anything that satisfies `Chain` to resolve. Returns a chainable, which resolves to `x` with all its inner chainables resolved. If an inner chainable resolves to an `error?` value, the resolved value will be the first such value encountered instead of the resolved `x`. If `mapper` is given, each inner value of `x` will be passed through it; allowing for substitution. If the value is a chainable, then the resolved value will be passed.
(chainable f)
Invokes f
with a continue
function. Returns
something that satisfies Chain
. When continue
is called, the chainable will resolve to its argument.
Invokes `f` with a `continue` function. Returns something that satisfies `Chain`. When `continue` is called, the chainable will resolve to its argument.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close