mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 17:01:11 +00:00
pass-through function interceptors
This commit is contained in:
parent
92638dbb20
commit
fd8985fd75
2 changed files with 6 additions and 1 deletions
|
|
@ -60,6 +60,7 @@
|
||||||
(into-interceptor [this data opts]
|
(into-interceptor [this data opts]
|
||||||
(into-interceptor
|
(into-interceptor
|
||||||
{:name ::handler
|
{:name ::handler
|
||||||
|
::handler this
|
||||||
:enter (fn [ctx]
|
:enter (fn [ctx]
|
||||||
(assoc ctx :response (this (:request ctx))))}
|
(assoc ctx :response (this (:request ctx))))}
|
||||||
data opts))
|
data opts))
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@
|
||||||
(reify
|
(reify
|
||||||
interceptor/Executor
|
interceptor/Executor
|
||||||
(queue [_ interceptors]
|
(queue [_ interceptors]
|
||||||
(queue/into-queue interceptors))
|
(queue/into-queue
|
||||||
|
(map
|
||||||
|
(fn [{:keys [::interceptor/handler] :as interceptor}]
|
||||||
|
(or handler interceptor))
|
||||||
|
interceptors)))
|
||||||
(execute [_ interceptors request]
|
(execute [_ interceptors request]
|
||||||
(sieppari/execute interceptors request))
|
(sieppari/execute interceptors request))
|
||||||
(execute [_ interceptors request respond raise]
|
(execute [_ interceptors request respond raise]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue