Skip to content

Commit 20bb9e6

Browse files
author
awb99
committed
path is interpreted as a value, not a get-in path.
1 parent f676e31 commit 20bb9e6

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

demo/src/demo/page/options.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
:temperature 36.4
1616
; bool
1717
:run-parallel true
18-
:environment {:enabled true}
18+
[:environment :enabled] true
1919
; string
2020
:search ""
2121
; view

src/options/core.cljs

+2-18
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,11 @@
3434
(get-editor-fn config current-val)]))
3535

3636
(defn get-value [state path]
37-
(cond
38-
(keyword? path)
39-
(path @state)
40-
41-
(vector? path)
42-
(get-in @state path)
43-
44-
:else
45-
nil))
37+
(get @state path))
4638

4739
(defn set-value [state path v]
4840
(println "set-value path: " path " value: " v)
49-
(cond
50-
(keyword? path)
51-
(swap! state assoc path v)
52-
53-
(vector? path)
54-
(swap! state assoc-in path v)
55-
56-
:else
57-
nil))
41+
(swap! state assoc path v))
5842

5943
(defn create-edit-element [state options]
6044
[edit-element {:set-fn #(set-value state (:path options) %)

0 commit comments

Comments
 (0)