fixes #425
This commit is contained in:
parent
a509b21abf
commit
682aed49cd
|
@ -1,7 +1,8 @@
|
|||
## Unreleased
|
||||
|
||||
#### New Features
|
||||
#### New
|
||||
|
||||
- add `purge-event-queue` to the API. See https://github.com/Day8/re-frame-test/issues/13 for motivation.
|
||||
- added [a new FAQ entry](/docs/FAQs/DoINeedReFrame.md) Reagent looks terrific. Why do I need re-frame?
|
||||
|
||||
## 0.10.2 (2017.10.07)
|
||||
|
|
|
@ -191,6 +191,10 @@
|
|||
(reset! db/app-db app-db)
|
||||
nil)))
|
||||
|
||||
(defn purge-event-queue
|
||||
"Remove all events queued for processing"
|
||||
[]
|
||||
(router/purge re-frame.router/event-queue))
|
||||
|
||||
;; -- Event Processing Callbacks ---------------------------------------------
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
(push [this event])
|
||||
(add-post-event-callback [this id callack])
|
||||
(remove-post-event-callback [this f])
|
||||
(purge [this])
|
||||
|
||||
;; -- Implementation via a Finite State Machine
|
||||
(-fsm-trigger [this trigger arg])
|
||||
|
@ -113,6 +114,8 @@
|
|||
(->> (dissoc post-event-callback-fns id)
|
||||
(set! post-event-callback-fns))))
|
||||
|
||||
(purge [_]
|
||||
(set! queue empty-queue))
|
||||
|
||||
;; -- FSM Implementation ---------------------------------------------------
|
||||
|
||||
|
@ -195,8 +198,8 @@
|
|||
(recur (dec n)))))))
|
||||
|
||||
(-exception
|
||||
[_ ex]
|
||||
(set! queue empty-queue) ;; purge the queue
|
||||
[this ex]
|
||||
(purge this) ;; purge the queue
|
||||
(throw ex))
|
||||
|
||||
(-pause
|
||||
|
|
Loading…
Reference in New Issue