         (handler db event-vec)))))
 
 (def undoable (with-meta undoable_ {:re-frame-factory-name "undoable"}))
-
-
-
-;; middleware
-(defn fsm-trigger
-  [trigger update-fn fsm-path]
-  (fn fsm-middleware
-    [handler]
-    (fn fsm-handler
-      [db event-v]
-      (let [new-db (handler db event-v)]
-         (update-fn new-db event-v trigger fsm-path)))))   ;; think about access to event-v
-

;;
;;
(def ^:private config (atom {:max-undos 50   ;; Maximum number of undo states maintained
                             :path  []}))     ;; undo and redos will apply to only this path within app-db
(defn set-max-undos!
  [n]
  (swap! config assoc :max-undos n))

  [n]
  (when (and (pos? n) (redos?))
    (redo undo-list app-db redo-list)
    (redo-explain undo-explain-list app-explain redo-explain-list)
    (recur (dec n))))

(handlers/register-base     ;; not a pure handler
