This is very naive implementation of interceptors and it's a subject to change. Consider this namespace as an alfa.
This is very naive implementation of interceptors and it's a subject to change. Consider this namespace as an alfa.
(definterceptor ?sym & ?attrs)
Defines an interceptor out of map {:leave (fn [response] response)? :enter (fn [request] request)?}. Interceptors should be passed to lambda as a mixin.
Usage:
(definterceptor ExampleInterceptor
{:leave (fn [response] (hr/origin response "*"))
:enter (fn [request] (println "I will log a request" request) request)})
Defines an interceptor out of map {:leave (fn [response] response)? :enter (fn [request] request)?}. Interceptors should be passed to lambda as a mixin. Usage: ``` (definterceptor ExampleInterceptor {:leave (fn [response] (hr/origin response "*")) :enter (fn [request] (println "I will log a request" request) request)}) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close