the form is pretty good now.
This commit is contained in:
@@ -59,6 +59,22 @@
|
||||
db
|
||||
(partition 2 path-pairs))))
|
||||
|
||||
(defn change-handler [form customize-fn]
|
||||
(fn [db [_ & path-pairs]]
|
||||
(println "CHA" form path-pairs)
|
||||
(reduce
|
||||
(fn [db [path value]]
|
||||
(println "PATH" path "VALUE" value)
|
||||
(let [updated (assoc-in db (into [::forms form :data] path) value)]
|
||||
(reduce
|
||||
(fn [updated [path value ]]
|
||||
(println "custom PATH" path "custom VALUE" value)
|
||||
(assoc-in updated (into [::forms form :data] path) value))
|
||||
updated
|
||||
(partition 2 (customize-fn (get-in updated [::forms form :data]) path value)))))
|
||||
db
|
||||
(partition 2 path-pairs))))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::save-error
|
||||
(fn [db [_ form result]]
|
||||
|
||||
Reference in New Issue
Block a user