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:
parent
9125b46ca5
commit
80e17f8cfc
1 changed files with 19 additions and 15 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue