mirror of
https://github.com/status-im/re-frame.git
synced 2025-02-24 07:48:14 +00:00
make run-queue more compact
This commit is contained in:
parent
aedafd1ac9
commit
6551c010b3
@ -111,15 +111,13 @@
|
|||||||
;; Be aware that events might have metadata which will pause processing.
|
;; Be aware that events might have metadata which will pause processing.
|
||||||
(-run-queue
|
(-run-queue
|
||||||
[this]
|
[this]
|
||||||
(let [queue-length (count queue)]
|
(loop [n (count queue)]
|
||||||
(loop [n queue-length]
|
|
||||||
(if (zero? n)
|
(if (zero? n)
|
||||||
(-fsm-trigger this :finish-run nil)
|
(-fsm-trigger this :finish-run nil)
|
||||||
(let [event-v (peek queue)]
|
(if-let [later-fn (some later-fns (-> queue peek meta keys))]
|
||||||
(if-let [later-fn (some later-fns (keys (meta event-v)))]
|
|
||||||
(-fsm-trigger this :pause-run later-fn)
|
(-fsm-trigger this :pause-run later-fn)
|
||||||
(do (-process-1st-event this)
|
(do (-process-1st-event this)
|
||||||
(recur (dec n)))))))))
|
(recur (dec n)))))))
|
||||||
|
|
||||||
(-pause-run
|
(-pause-run
|
||||||
[this later-fn]
|
[this later-fn]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user