Fork me on GitHub
#specter
<
2018-01-12
>
phreed00:01:18

@nathanmarz Yes I have been using the collect twins with select which constructs a seq. I will take a look at the example.

schmee08:01:36

is there a way to make transform halt after the first successful navigation, something like transform-one?

schmee08:01:46

I’m thinking about this case:

user=> (def a [{:name "foo" :id 1} {:name "bar" :id 2}])
#'user/a
user=> (transform [ALL (selected? :id (pred= 2))] #(assoc % :name "not-foo") a)
[{:id 1 :name "foo"} {:id 2 :name "not-foo"}]

schmee08:01:28

since ids are unique, there will only be one element selected so there is no need to check the rest of the elements once it has been found

schmee08:01:45

I don’t know if that makes any sense 😄

nathanmarz14:01:51

@schmee no, nothing like that currently

nathanmarz14:01:42

this idea might be applicable to that kind of behavior: https://github.com/nathanmarz/specter/issues/121

schmee14:01:22

yeah that seems to be it, I’ll keep an eye on that issue :thumbsup: