invoice number like incorporates a timeout.

This commit is contained in:
Bryce Covert
2019-02-08 07:40:14 -08:00
parent dccaecf86b
commit 111710365b
2 changed files with 31 additions and 5 deletions

View File

@@ -119,6 +119,19 @@
node))
m))
(defonce timeouts
(atom {}))
(re-frame/reg-fx
:dispatch-debounce
(fn [{:keys [event time key]}]
(js/clearTimeout (@timeouts key))
(swap! timeouts assoc key
(js/setTimeout (fn []
(re-frame/dispatch event)
(swap! timeouts dissoc key))
time))))
(re-frame/reg-fx
:graphql
(fn [{:keys [query on-success on-error token variables query-obj]}]