 
 
 ;; warning: untested
-(defn log-events
+#_(defn log-events
   "Middleware that logs events (vec) using to the given logger fucntion"
   [logger]
   (fn middleware

  (:require
    [reagent.ratom  :refer [IReactiveAtom]]
    [re-frame.undo  :refer [store-now!]]
    [re-frame.utils :refer [warn]]))


;; Read this:  https://github.com/Day8/re-frame/wiki/Middleware


(defn pure
  "Middleware which adapts a pure handler to the non-pure standard calling convention"
  [handler]
  (fn new-handler
    [app-db event-vec]
    (assert (satisfies? IReactiveAtom app-db)
            (str "re-frame: pure not given a Ratom" (if (map? app-db) ". Perhaps \"pure\" is used twice.")))
    (reset! app-db (handler @app-db event-vec))))



;; warning: untested



(defn trim-v
  "Middleware which removes the first element of v. It means you can write
  more asthetically pleasing handlers"
  [handler]
  (fn new-handler
    [db v]
    (handler db (vec (rest v)))))


(defn path
  "Supplies a sub-tree of `app-db` to the handler.
  Assumes pure is in the middleware pipeline prior.
