♻️ 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

@ -10,19 +10,22 @@
[app.common.geom.shapes :as gsh]
[app.common.pages :as cp]
[app.common.pages.helpers :as cph]
[app.common.pprint :as pp]
[app.common.schema :as sm]
[app.common.uuid :as uuid]
[app.main.data.workspace :as dw]
[beicon.core :as rx]
[cljs.pprint :refer [pprint]]
[cljs.test :as t :include-macros true]
[cljs.test :as t]
[potok.core :as ptk]))
;; ---- Helpers to manage global events
(defn on-error
[cause]
(js/console.log "[CAUSE]:" (.-stack cause))
(js/console.log "[DATA]:" (pr-str (ex-data cause))))
(js/console.log "STORE ERROR" (.-stack cause))
(when-let [data (some-> cause ex-data ::sm/explain)]
(pp/pprint (sm/humanize-data data))))
(defn prepare-store
"Create a store with the given initial state. Wait until