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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |