minor refactoring of ATOM and update changelog
This commit is contained in:
parent
4a5f0b79b8
commit
1d77d295fa
2 changed files with 12 additions and 11 deletions
|
|
@ -1,5 +1,6 @@
|
|||
## 0.10.1 (unreleased)
|
||||
* Added `must` navigator
|
||||
* Added `ATOM` navigator (thanks @rakeshp)
|
||||
|
||||
## 0.10.0
|
||||
* Make codebase bootstrap cljs compatible
|
||||
|
|
|
|||
|
|
@ -279,17 +279,6 @@
|
|||
(assoc structure key (next-fn (get structure key)))
|
||||
))
|
||||
|
||||
(defpath
|
||||
^{:doc "Navigates to atom value."}
|
||||
ATOM
|
||||
[]
|
||||
(select* [this structure next-fn]
|
||||
(next-fn @structure))
|
||||
(transform* [this structure next-fn]
|
||||
(do
|
||||
(reset! structure (next-fn @structure))
|
||||
structure)))
|
||||
|
||||
(defpath
|
||||
^{:doc "Navigates to the key only if it exists in the map."}
|
||||
must
|
||||
|
|
@ -320,6 +309,17 @@
|
|||
(unparse-fn (next-fn (parse-fn structure)))
|
||||
))
|
||||
|
||||
(defpath
|
||||
^{:doc "Navigates to atom value."}
|
||||
ATOM
|
||||
[]
|
||||
(select* [this structure next-fn]
|
||||
(next-fn @structure))
|
||||
(transform* [this structure next-fn]
|
||||
(do
|
||||
(swap! structure next-fn)
|
||||
structure)))
|
||||
|
||||
(defn selected?
|
||||
"Filters the current value based on whether a path finds anything.
|
||||
e.g. (selected? :vals ALL even?) keeps the current element only if an
|
||||
|
|
|
|||
Loading…
Reference in a new issue