implementing sorting for checks.

This commit is contained in:
Bryce Covert
2019-05-04 12:25:55 -07:00
parent f8d8872131
commit 976d37d641
5 changed files with 120 additions and 86 deletions

View File

@@ -61,14 +61,11 @@
(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)))))
@@ -118,7 +115,7 @@
(.stopPropagation e)
(.preventDefault e))
(when can-submit
(re-frame/dispatch-sync (conj submit-event params))))}
(re-frame/dispatch-sync (vec (conj submit-event params)))))}
[:h1.title.is-2 title]
]