Partially fix #43 by adding ability to clear both kinds of handlers.
This commit is contained in:
parent
3cf565c8d4
commit
c1fe51ddfd
|
@ -12,9 +12,12 @@
|
||||||
(def dispatch-sync router/dispatch-sync)
|
(def dispatch-sync router/dispatch-sync)
|
||||||
|
|
||||||
(def register-sub subs/register)
|
(def register-sub subs/register)
|
||||||
|
(def clear-sub-handlers! subs/clear-handlers!)
|
||||||
(def subscribe subs/subscribe)
|
(def subscribe subs/subscribe)
|
||||||
|
|
||||||
|
|
||||||
|
(def clear-event-handlers! handlers/clear-handlers!)
|
||||||
|
|
||||||
|
|
||||||
(def pure middleware/pure)
|
(def pure middleware/pure)
|
||||||
(def debug middleware/debug)
|
(def debug middleware/debug)
|
||||||
|
|
|
@ -33,6 +33,12 @@
|
||||||
(get @id->fn event-id))
|
(get @id->fn event-id))
|
||||||
|
|
||||||
|
|
||||||
|
(defn clear-handlers!
|
||||||
|
"Unregister all event handlers"
|
||||||
|
[]
|
||||||
|
(reset! id->fn {}))
|
||||||
|
|
||||||
|
|
||||||
(defn register-base
|
(defn register-base
|
||||||
"register a handler for an event.
|
"register a handler for an event.
|
||||||
This is low level and it is expected that \"re-frame.core/register-handler\" would
|
This is low level and it is expected that \"re-frame.core/register-handler\" would
|
||||||
|
|
|
@ -9,6 +9,12 @@
|
||||||
(def ^:private key->fn (atom {}))
|
(def ^:private key->fn (atom {}))
|
||||||
|
|
||||||
|
|
||||||
|
(defn clear-handlers!
|
||||||
|
"Unregister all subscription handlers"
|
||||||
|
[]
|
||||||
|
(reset! key->fn {}))
|
||||||
|
|
||||||
|
|
||||||
(defn register
|
(defn register
|
||||||
"register a hander function for an id"
|
"register a hander function for an id"
|
||||||
[key-v handler-fn]
|
[key-v handler-fn]
|
||||||
|
|
Loading…
Reference in New Issue