arachne.pedestal

component-interceptor

(component-interceptor interceptor-map)
Utility to help build interceptor components with dependencies.

Takes a Pedestal-style interceptor map and returns an object satisfying Pedestal IntoInterceptor.

The difference iswever, in the map passed to this function, each of the handler functions (for
:enter, :leave and :error) takes an additional first argument, the component instance itself.
This is intended to make it easy to write interceptors that have access to their dependencies.

For example:

(component-interceptor
  {:enter (fn [component ctx] ...)
   :leave (fn [component ctx] ...)
   :error (fn [component ctx ex] ...)})