Improve performance and many of unexpected conflicts on page save.

This commit is contained in:
Andrey Antukh 2016-12-25 21:38:56 +01:00
parent cf55aeda63
commit 87e19875e3
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -176,10 +176,10 @@
(deftype PagePersisted [data]
ptk/UpdateEvent
(update [_ state]
;; TODO: update only the version instead of complete unpacking
;; this will improve the application responsiveness when multiple
;; updates are performed
(assoc-page state data)))
(let [{:keys [id version]} data]
(-> state
(assoc-in [:pages id :version] version)
(assoc-packed-page data)))))
(defn- page-persisted?
[event]