♻️ Refactor change builder for make it more efficient

Mainly replaces the usafe of the inneficient d/preconj helper
with a combination of conj and simple list as data structure whitch
maintains the previous ordering semantics on addition.

Also removes the d/preconj from the codebase.
This commit is contained in:
Andrey Antukh 2023-09-01 15:33:41 +02:00
parent 4e974cd2f3
commit 5b3e12bb9c
9 changed files with 326 additions and 294 deletions

View file

@ -178,9 +178,11 @@
[{:keys [redo-changes undo-changes
origin save-undo? file-id undo-group tags stack-undo?]
:or {save-undo? true stack-undo? false tags #{} undo-group (uuid/next)}}]
(let [error (volatile! nil)
page-id (:current-page-id @st/state)
frames (changed-frames redo-changes (wsh/lookup-page-objects @st/state))]
(let [error (volatile! nil)
page-id (:current-page-id @st/state)
frames (changed-frames redo-changes (wsh/lookup-page-objects @st/state))
undo-changes (vec undo-changes)
redo-changes (vec redo-changes)]
(ptk/reify ::commit-changes
cljs.core/IDeref
(-deref [_]