fix replace-in to work with value collection

This commit is contained in:
Nathan Marz 2016-01-12 16:25:02 -05:00
parent 49c749b74e
commit b3b6b99e7a
2 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,7 @@
* Better syntax checking for defpath
* Fixed bug in protocol paths (#48)
* Protocol paths error when extension has invalid number of needed parameters
* Fix replace-in to work with value collection
## 0.9.1
* Fixed reflection in protocol path code

View file

@ -103,15 +103,15 @@
[selector transform-fn structure & {:keys [merge-fn] :or {merge-fn concat}}]
(let [state (i/mutable-cell nil)]
[(compiled-transform selector
(fn [e]
(let [res (transform-fn e)]
(fn [& args]
(let [res (apply transform-fn args)]
(if res
(let [[ret user-ret] res]
(->> user-ret
(merge-fn (i/get-cell state))
(i/set-cell! state))
ret)
e
(last args)
)))
structure)
(i/get-cell state)]