 
 ;; --- Pages Fetched
 
-(defrecord PagesFetched [pages]
+(deftype PagesFetched [pages]
   ptk/UpdateEvent
   (update [_ state]
     (as-> state $


;; --- Delete Page (by id)

(defrecord DeletePage [id callback]
  ptk/WatchEvent
  (watch [_ state s]
    (letfn [(on-success [_]

  (s/keys :req-un [::name ::project ::width ::height ::layout]))

(defn create-page
  [{:keys [name project width height layout] :as data}]
  {:pre [(us/valid? ::create-page-event data)]}
  (->CreatePage name project width height layout))

;; --- Page Persisted

(deftype PagePersisted [data]
  ptk/UpdateEvent
  (update [_ state]
    ;; TODO: update only the version instead of complete unpacking
