fixing gnarly usage of multi. Better approach is to always have innenr state.

This commit is contained in:
2022-05-16 21:00:00 -07:00
parent 88ba64f60f
commit d24f7a81a2

View File

@@ -175,12 +175,12 @@
(filter (fn [r] (filter (fn [r]
(not= [:key :new?] (keys r))) (not= [:key :new?] (keys r)))
(assoc-in value (into [i] (get-in template [1 :field])) (assoc-in value (into [i] (get-in template [1 :field]))
(update (let [this-value (if (and e (.. e -target))
(if (and e (.. e -target)) (.. e -target -value )
(.. e -target -value ) e)]
e) (if (map? this-value)
:key (update this-value :key (fnil identity (random-uuid)))
(fnil identity (random-uuid))) )))) this-value)) ))))
(on-change (mapv (on-change (mapv
(fn [v] (fn [v]
(dissoc v :new? :key)) (dissoc v :new? :key))