   Includes a clojure.data/diff of the db, before vs after, showing the changes
   caused by the event."
   [handler]
-  (fn new-handler
+  (fn debug-handler
     [db v]
     (if (satisfies? IReactiveAtom db)
       (str "re-frame: \"debug\" middleware used without prior \"pure\"."))

  [f]
  (fn middleware
    [handler]
    (fn new-handler
      [db v]
      (f (handler db v)))))


  [f]
  (fn middleware
    [handler]
    (fn after-handler
      [db v]
      (let [new-db (handler db v)]
        (f new-db)   ;; call f for side effects
