From c34e9004276c2eafa15aabe5a5cf0b9d9426111b Mon Sep 17 00:00:00 2001 From: Thomas Athorne Date: Sat, 16 Apr 2016 17:16:23 +0100 Subject: [PATCH] Add `biview` path. --- VERSION | 2 +- src/clj/com/rpl/specter.cljx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 965065d..87b8891 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.3 +0.9.4-SNAPSHOT diff --git a/src/clj/com/rpl/specter.cljx b/src/clj/com/rpl/specter.cljx index d1b403e..12bb528 100644 --- a/src/clj/com/rpl/specter.cljx +++ b/src/clj/com/rpl/specter.cljx @@ -270,6 +270,13 @@ (next-fn (afn structure)) )) +(defpath biview [afn bfn] + (select* [this structure next-fn] + (next-fn (afn structure))) + (transform* [this structure next-fn] + (bfn (next-fn (afn structure))) + )) + (defn selected? "Filters the current value based on whether a selector finds anything. e.g. (selected? :vals ALL even?) keeps the current element only if an