add setval convenience function to api
This commit is contained in:
parent
7e192a81f0
commit
7613ffd74e
1 changed files with 2 additions and 0 deletions
|
|
@ -55,6 +55,8 @@
|
||||||
(apply update-fn (conj vals structure)))
|
(apply update-fn (conj vals structure)))
|
||||||
))))
|
))))
|
||||||
|
|
||||||
|
(defn setval [selector val structure]
|
||||||
|
(update selector (fn [_] val) structure))
|
||||||
|
|
||||||
(defn replace-in [selector update-fn structure & {:keys [merge-fn] :or {merge-fn concat}}]
|
(defn replace-in [selector update-fn structure & {:keys [merge-fn] :or {merge-fn concat}}]
|
||||||
"Returns [new structure [<user-ret> <user-ret>...]"
|
"Returns [new structure [<user-ret> <user-ret>...]"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue