Fork me on GitHub
#duct
<
2019-05-21
>
myguidingstar10:05:32

question about ataraxy metadata syntax for middlewares: the order of middlewares are not guaranteed because they are hashmap keys produced by clojure reader. How do I denote the exact order? any alternative syntax?

weavejester23:05:39

Currently I think the only way to guarantee the order is to compose the two middleware functions.

weavejester23:05:05

I’ve been considering a way of determining the order of metadata through dependencies that might help in future.

myguidingstar15:05:21

I think it would be convenient to compose middlewares with config like this:

{:duct.router/ataraxy
  {:routes {[:get "/path"] ^:wrap-c [:some-handler]}
   :middleware
   {:wrap-a #ig/ref ...
    :wrap-b #ig/ref ...
    :wrap-c [:wrap-a :wrap-b]}}}