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 register-sub subs/register)
|
||||
(def clear-sub-handlers! subs/clear-handlers!)
|
||||
(def subscribe subs/subscribe)
|
||||
|
||||
|
||||
(def clear-event-handlers! handlers/clear-handlers!)
|
||||
|
||||
|
||||
(def pure middleware/pure)
|
||||
(def debug middleware/debug)
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
(get @id->fn event-id))
|
||||
|
||||
|
||||
(defn clear-handlers!
|
||||
"Unregister all event handlers"
|
||||
[]
|
||||
(reset! id->fn {}))
|
||||
|
||||
|
||||
(defn register-base
|
||||
"register a handler for an event.
|
||||
This is low level and it is expected that \"re-frame.core/register-handler\" would
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
(def ^:private key->fn (atom {}))
|
||||
|
||||
|
||||
(defn clear-handlers!
|
||||
"Unregister all subscription handlers"
|
||||
[]
|
||||
(reset! key->fn {}))
|
||||
|
||||
|
||||
(defn register
|
||||
"register a hander function for an id"
|
||||
[key-v handler-fn]
|
||||
|
|
Loading…
Reference in New Issue