0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

Add new signature for the run-store test helper

This commit is contained in:
alonso.torres 2024-07-03 15:22:42 +02:00
parent 9125b46ca5
commit 80e17f8cfc

View file

@ -39,10 +39,14 @@
store))
(defn run-store
[store done events completed-cb]
([store done events completed-cb]
(run-store store done events completed-cb nil))
([store done events completed-cb stopper]
(let [stream (ptk/input-stream store)]
(->> stream
(rx/take-until (rx/filter #(= :the/end %) stream))
(rx/take-until (if stopper
(stopper stream)
(rx/filter #(= :the/end %) stream)))
(rx/last)
(rx/tap (fn []
(completed-cb @store)))
@ -53,7 +57,7 @@
(js/console.log "[complete]"))))
(doall (for [event events]
(ptk/emit! store event)))
(ptk/emit! store :the/end)))
(ptk/emit! store :the/end))))
(defn get-file-from-store
[store]