0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

🎉 Add convenience helper for http client

This commit is contained in:
Andrey Antukh 2022-07-28 15:10:36 +02:00
parent d30b6ac5b9
commit 15d7b94940

View file

@ -12,6 +12,8 @@
[integrant.core :as ig]
[java-http-clj.core :as http]))
(s/def ::client fn?)
(defmethod ig/pre-init-spec :app.http/client [_]
(s/keys :req-un [::wrk/executor]))
@ -28,3 +30,12 @@
(http/send req {:client client :as response-type})
(http/send-async req {:client client :as response-type}))))
{::client client})))
(defn req!
"A convencience toplevel function for gradual migration to a new API
convention."
([client request]
(client request))
([client request options]
(client request options)))