0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

Update with upstream

This commit is contained in:
Florian Schroedl 2024-08-07 17:14:05 +02:00
parent 192f847d50
commit d8621974c2

View file

@ -48,21 +48,22 @@
([store done events completed-cb] ([store done events completed-cb]
(run-store store done events completed-cb nil)) (run-store store done events completed-cb nil))
([store done events completed-cb stopper] ([store done events completed-cb stopper]
(let [stream (ptk/input-stream store)] (let [stream (ptk/input-stream store)
stopper-s (if (fn? stopper)
(stopper stream)
(rx/filter #(= :the/end %) stream))]
(->> stream (->> stream
(rx/take-until (if stopper (rx/take-until stopper-s)
(stopper stream)
(rx/filter #(= :the/end %) stream)))
(rx/last) (rx/last)
(rx/tap (fn [] (rx/tap (fn [_]
(completed-cb @store))) (completed-cb @store)))
(rx/subs! (fn [_] (done)) (rx/subs! (fn [_] (done))
(fn [cause] (fn [cause]
(js/console.log "[error]:" cause)) (js/console.log "[error]:" cause))
(fn [_] (fn [_]
#_(js/console.log "[complete]")))) #_(js/console.log "[complete]"))))
(doall (for [event (concat events [(end+)])] (doseq [event (concat events [(end+)])]
(ptk/emit! store event))) (ptk/emit! store event))
(ptk/emit! store :the/end)))) (ptk/emit! store :the/end))))
(defn run-store-async (defn run-store-async