This commit is contained in:
Tommi Reiman 2018-07-27 15:10:02 +03:00
parent e879e66f26
commit 055a03c793
2 changed files with 17 additions and 11 deletions

View file

@ -24,11 +24,14 @@
(defn handler [ctx]
(conj ctx :ok))
(defn create [interceptors]
(defn create
([interceptors]
(create interceptors nil))
([interceptors opts]
(let [chain (interceptor/chain
interceptors
handler :data nil)]
(partial execute chain)))
handler :data opts)]
(partial execute chain))))
(deftest expand-interceptor-test

View file

@ -10,12 +10,15 @@
(defn handler [request]
(conj request :ok))
(defn create [middleware]
(defn create
([middleware]
(create middleware nil))
([middleware opts]
(middleware/chain
middleware
handler
:data
nil))
opts)))
(deftest expand-middleware-test