♻️ 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

@ -147,8 +147,8 @@
history (:history state)
router (:router state)]
(ts/schedule #(on-change router (.getToken ^js history)))
(->> (rx/create (fn [sink]
(let [key (e/listen history "navigate" (fn [o] (sink (.-token ^js o))))]
(->> (rx/create (fn [subs]
(let [key (e/listen history "navigate" (fn [o] (rx/push! subs (.-token ^js o))))]
(fn []
(bhistory/disable! history)
(e/unlistenByKey key)))))