 (defn- redo
   [undos cur redos]
   (let [u (conj @undos @cur)
+        r  @redos
+        path (undo-path-ks)]
+    (if path
+      (swap! cur assoc-in path (first r))
+      (reset! cur (first r)))
+    (reset! redos (rest r))
+    (reset! undos u)))
+
+(defn- redo-explain
+  [undos cur redos]
+  (let [u (conj @undos @cur)
         r  @redos]
-    (swap! cur assoc-in (undo-path-ks) (first r))
+    (reset! cur (first r))
     (reset! redos (rest r))
     (reset! undos u)))
 

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

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

        (handler db event-vec)))))

(def undoable (with-meta undoable_ {:re-frame-factory-name "undoable"}))
