From b32aeab413d78e25e0468c10cf5e7df1a7fbaef5 Mon Sep 17 00:00:00 2001 From: "Stephen C. Gilardi" Date: Wed, 4 Nov 2015 00:10:28 -0500 Subject: [PATCH 1/2] fix [:do-paused :add-event] state transition --- src/re_frame/router.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/re_frame/router.cljs b/src/re_frame/router.cljs index 6532c48..3351ed3 100644 --- a/src/re_frame/router.cljs +++ b/src/re_frame/router.cljs @@ -161,7 +161,7 @@ [:paused :resume-run ] [:do-paused #(-resume-run this)] ;; processing an event which previously caused the queue to be paused - [:do-paused :add-event ] [:paused #(-add-event this arg1)] + [:do-paused :add-event ] [:do-paused #(-add-event this arg1)] [:do-paused :exception ] [:quiescent #(-exception this arg1)] [:do-paused :done-paused] [:running #(-run-queue this)] From 4be6227b0231e64fc05e24169d01902bde57b470 Mon Sep 17 00:00:00 2001 From: "Stephen C. Gilardi" Date: Wed, 4 Nov 2015 00:14:11 -0500 Subject: [PATCH 2/2] revise fsm terminology around resuming --- src/re_frame/router.cljs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/re_frame/router.cljs b/src/re_frame/router.cljs index 3351ed3..fb6828a 100644 --- a/src/re_frame/router.cljs +++ b/src/re_frame/router.cljs @@ -125,12 +125,12 @@ later (cond (:flush-dom m) do-later ;; after next annimation frame (:yield m) goog.async.nextTick)] ;; almost immediately - (later #(-fsm-trigger this :resume-run nil)))) + (later #(-fsm-trigger this :begin-resume nil)))) (-resume-run [this] (-process-1st-event this) ;; do the event which paused processing - (-fsm-trigger this :done-paused nil)) ;; do the rest of the queued events + (-fsm-trigger this :finish-resume nil)) ;; do the rest of the queued events (-fsm-trigger [this trigger arg1] @@ -157,13 +157,13 @@ [:scheduled #(-run-next-tick this)]) ;; event processing is paused - probably by :flush-dom metadata - [:paused :add-event ] [:paused #(-add-event this arg1)] - [:paused :resume-run ] [:do-paused #(-resume-run this)] + [:paused :add-event ] [:paused #(-add-event this arg1)] + [:paused :begin-resume ] [:resuming #(-resume-run this)] ;; processing an event which previously caused the queue to be paused - [:do-paused :add-event ] [:do-paused #(-add-event this arg1)] - [:do-paused :exception ] [:quiescent #(-exception this arg1)] - [:do-paused :done-paused] [:running #(-run-queue this)] + [:resuming :add-event ] [:resuming #(-add-event this arg1)] + [:resuming :exception ] [:quiescent #(-exception this arg1)] + [:resuming :finish-resume] [:running #(-run-queue this)] (throw (str "re-frame: state transition not found. " fsm-state " " trigger)))]