diff --git a/src/clj/com/rpl/specter.cljx b/src/clj/com/rpl/specter.cljx index 8a3499e..210356a 100644 --- a/src/clj/com/rpl/specter.cljx +++ b/src/clj/com/rpl/specter.cljx @@ -279,6 +279,17 @@ (assoc structure key (next-fn (get structure key))) )) +(defpath + ^{:doc "Navigates to atom value."} + atompath + [] + (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