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


(defn enrich
  "Middleware factory which runs a given function \"f\" in the after position.
  \"f\" is (db) -> db
  Unlike \"after\" which is about side effects, \"enrich\" expects f to process and alter
  db in some useful way, contributing to the derived data, flowing vibe.
  Imagine that todomvc needed to do duplicate detection - if any two todos had

    [handler]
    (fn validate-handler
      [db v]
      (f (handler db v) v))))



