♻️ Refactor http client.

Start using Fetch API.
This commit is contained in:
Andrey Antukh 2021-04-09 17:21:34 +02:00 committed by Alonso Torres
parent 9a0f6018a7
commit 7d14aef393
15 changed files with 257 additions and 305 deletions

View file

@ -15,7 +15,7 @@
[app.main.fonts :as fonts]
[app.main.exports :as exports]
[app.worker.impl :as impl]
[app.util.http-api :as http]
[app.util.http :as http]
["react-dom/server" :as rds]))
(defn- handle-response
@ -39,6 +39,7 @@
(->> (http/send! {:uri uri
:query {:file-id file-id :id page-id}
:method :get})
(rx/map http/conditional-decode-transit)
(rx/mapcat handle-response)
(rx/subs (fn [body]
(resolve body))