       (logger v)
       (handler db v))))
 
-
-;; warning: untested
-;; check the state of db AFTER the handler has run, using a prismatic Schema.
-#_(defn check-schema
-"Middleware for checking that a handlers mutations leave the state in a schema-matching way"
-[a-prismatic-schema]
-(fn middleware
-  [next-handler]
-  (fn handler
-    [db v]
-    (let [val    (next-handler db v)
-          valid? true]   ;; XXXXX  replace true by code which checks the schema using original parameter
-      (if (not valid?)
-        (warn "re-frame: schema not valid after:" v))
-      val))))


(defn trim-v
  "Middleware which removes the first element of v. Its use means you can write
  more asthetically pleasing handlers.
  Your handlers will look like this:
      (defn my-handler
        [db [x y z]]    ;; <-- instead of [_ x y z]


(defn debug
  "Middleware which logs debug information to js/console for each event.
  Includes a clojure.data/diff of the db, before vs after, showing the changes
  caused by the event."
  [handler]
  (fn new-handler
    [db v]
