(<< kind & args)
Creates an injection with a depth of 0.
Creates an injection with a depth of 0.
(<<ctx & path)
Creates a ::context injector.
(<<ctx :path :to :context :value)
These simply inject a value from the current context.
Creates a ::context injector. ``` (<<ctx :path :to :context :value) ``` These simply inject a value from the current context.
(<<err & data)
Creates an ::error injector, which injects an error with in a way that doesn't cause failure.
Creates an ::error injector, which injects an error with in a way that doesn't cause failure.
(act & items)
Create an action. Use like (act {:as headers} & effects)
or (act & effects)
,
where each effect is a vector with an effect kind, and zero or more args.
Create an action. Use like `(act {:as headers} & effects)` or `(act & effects)`, where each effect is a vector with an effect kind, and zero or more args.
(action? x)
Returns true if x
is an action.
Returns true if `x` is an action.
(decide & args)
Creates an ::decide injector.
(decide
(fn [x y]
(if (= x y)
[:my-effecy x]
[:my-other-effect x y]))
(<< :inject-x)
(<< :inject-y))
Decision injections evaluate the given pure function, with the provided (generally injected) arguments. Injecting the result.
Creates an ::decide injector. ``` (decide (fn [x y] (if (= x y) [:my-effecy x] [:my-other-effect x y])) (<< :inject-x) (<< :inject-y)) ``` Decision injections evaluate the given pure function, with the provided (generally injected) arguments. Injecting the result.
(dispatcher interceptors & {:keys [context-builder]})
Create a dispatcher. interceptors
is an ordered collection
of interceptors. context-builder
is an optional function
that takes a minimal initial dispatch context, and returns
a modified version of the same.
Create a dispatcher. `interceptors` is an ordered collection of interceptors. `context-builder` is an optional function that takes a minimal initial dispatch context, and returns a modified version of the same.
(effects executor injector)
Creates an interceptor for executing effects.
Creates an interceptor for executing effects.
(errors)
Creates an interceptor to log unhandled errors with clj-arsenal.log.
Creates an interceptor to log unhandled errors with clj-arsenal.log.
(execute-pending-effects executor
injector
{pending-effects :clj-arsenal.action/pending-effects
executed-effects :clj-arsenal.action/executed-effects
:as context}
continue)
(injection? x)
Returns true if x
is an injection.
Returns true if `x` is an injection.
(quote form)
Quotes form
, preventing injections from being applied.
Quotes `form`, preventing injections from being applied.
(with-default-injector injector)
Wraps your custom injector in one that handles built-in
injections like those produced by <<ctx
, with-inj
,
decide
.
Wraps your custom injector in one that handles built-in injections like those produced by `<<ctx`, `with-inj`, `decide`.
(with-inj bindings & body)
Syntax sugar around decide
.
(with-inj [foo (<<ctx :foo)
bar (<<ctx :bar)]
(+ foo bar))
Syntax sugar around `decide`. ``` (with-inj [foo (<<ctx :foo) bar (<<ctx :bar)] (+ foo bar)) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close