Prevent adding object map to not loaded pointer-map containers

This commit is contained in:
Andrey Antukh 2024-02-14 17:34:50 +01:00
parent 3212ed9bd1
commit ba55d657a4
3 changed files with 24 additions and 8 deletions

View file

@ -68,6 +68,7 @@
(get-id [_])
(load! [_])
(modified? [_])
(loaded? [_])
(clone [_]))
(deftype PointerMap [id mdata
@ -90,6 +91,7 @@
(or odata {}))
(modified? [_] modified?)
(loaded? [_] loaded?)
(get-id [_] id)
(clone [this]
@ -210,8 +212,6 @@
(defn create
([]
(let [id (uuid/next)
mdata (assoc *metadata* :created-at (dt/now))
pmap (PointerMap. id mdata {} true true)]
(some-> *tracked* (swap! assoc id pmap))