add helpful error messages which explain recent renaming

This commit is contained in:
Mike Thompson 2016-07-24 18:14:43 +10:00
parent 04be34d615
commit d2645c089d
1 changed files with 18 additions and 0 deletions

View File

@ -40,6 +40,7 @@
(def clear-event! events/clear-handler!) (def clear-event! events/clear-handler!)
;; Registers a pure event handler. Places pure middleware in the correct, LHS position. ;; Registers a pure event handler. Places pure middleware in the correct, LHS position.
(defn reg-event (defn reg-event
([id handler] ([id handler]
(events/register-base id pure handler)) (events/register-base id pure handler))
@ -94,3 +95,20 @@
(defn remove-post-event-callback (defn remove-post-event-callback
[f] [f]
(router/remove-post-event-callback re-frame.router/event-queue f)) (router/remove-post-event-callback re-frame.router/event-queue f))
;; -- Helpful Message
;; Assisting the v0.0.7 -> v0.0.8 tranistion. Remove in v0.0.9
(defn register-handler
[& args]
(console :error "re-frame: \"register-handler\" has been renamed \"reg-event\""))
(defn register-sub
[& args]
(console :error "re-frame: \"register-sub\" has been renamed \"reg-sub-raw\"."))
;; v0.0.8 alpha2 -> alpha3
(defn def-fx [& args] (console :error "re-frame: in v0.0.8-alpha3 \"def-fx\" was renamed \"reg-fx\"."))
(defn def-event [& args] (console :error "re-frame: in v0.0.8-alpha3 \"def-event\" was renamed \"reg-event\"."))
(defn def-sub [& args] (console :error "re-frame: in v0.0.8-alpha3 \"def-sub\" was renamed \"reg-sub\"."))