 (defrecord CleanPageHistory []
   rs/UpdateEvent
   (-apply-update [_ state]
-    (println "CleanPageHistory")
     (assoc-in state [:workspace :history] {})))
 
 (defn clean-page-history

(defrecord FetchPageHistory [id since max]
  rs/WatchEvent
  (-apply-watch [this state s]
    (println "FetchPageHistory" this)
    (letfn [(on-success [{history :payload}]
              (let [history (into [] history)]
                (->PageHistoryFetched history (not (nil? since)))))

(defrecord ApplySelectedHistory [id]
  rs/UpdateEvent
  (-apply-update [_ state]
    (-> state
        (update-in [:pages-by-id id] dissoc :history)
        (assoc-in [:workspace :history :selected] nil)))
