Closed p-himik closed 3 years ago
Calling reg-global-interceptor multiple times with the same exact interceptor (which is exactly what happens with code reloading) will add multiple copies of the same interceptor to the global interceptors queue.
reg-global-interceptor
Here's my current workaround:
(def reg-global-interceptor (if re-frame.interop/debug-enabled? (fn [interceptor] (let [existing-interceptors (re-frame.settings/get-global-interceptors)] (if (some #(= (:id %) (:id interceptor)) existing-interceptors) (do (rf/clear-global-interceptor) (doseq [i existing-interceptors] (rf/reg-global-interceptor (if (= (:id i) (:id interceptor)) interceptor i)))) (rf/reg-global-interceptor interceptor)))) rf/reg-global-interceptor))
Thanks for the bug report @p-himik
Fixed in v1.1.2
Calling
reg-global-interceptor
multiple times with the same exact interceptor (which is exactly what happens with code reloading) will add multiple copies of the same interceptor to the global interceptors queue.Here's my current workaround: