Liking cljdoc? Tell your friends :D

stepwise.interceptors.core


assert-named-chainclj

(assert-named-chain named-chain)
source

compileclj

(compile named-chain handler-fn)

Returns a fn that exercises a chain of interceptor-tuples against a task and returns a result. Uses metosin/siepppari under the hood.

Returns a fn that exercises a chain of interceptor-tuples against a task
and returns a result. Uses metosin/siepppari under the hood.
sourceraw docstring

well-formed-interceptor-tuple?clj

(well-formed-interceptor-tuple? interceptor-tuple)

Interceptor-tuple should be a tuple of the form, [:name {:enter (fn [ctx] ... (update ctx :request myfn1)) :leave (fn [ctx] ... (update ctx :response myfn2))}]

A few notes:

  1. :enter and :leave functions need to return ctx or an updated version of ctx for the next interceptor in the chain
  2. either :enter or :leave fn can be nil if not used
  3. incoming data are tucked away in :request for :enter fn
  4. outgoing data are in :response for :leave fn.

Reference: https://github.com/metosin/sieppari

Interceptor-tuple should be a tuple of the form,
[:name {:enter (fn [ctx] ... (update ctx :request myfn1))
        :leave (fn [ctx] ... (update ctx :response myfn2))}]

A few notes:

1. `:enter` and `:leave` functions need to return `ctx` or an updated
   version of `ctx` for the next interceptor in the chain
2. either `:enter` or `:leave` fn can be nil if not used
3. incoming data are tucked away in `:request` for `:enter` fn
4. outgoing data are in `:response` for `:leave` fn.

Reference:
https://github.com/metosin/sieppari
sourceraw docstring

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

× close