Fork me on GitHub
#specter
<
2016-09-28
>
vikeri14:09:14

What am I doing wrong here, I expect:

(select [MAP-VALS (filterer [:id #(= 1 %)])] {:h {:id 1 :ad 2} :ho {:id 2 :ad 3}})
To return [{:id 1 :ad 2}] but instead it returns [[] []]

nathanmarz14:09:01

@vikeri filterer treats input as a sequence

nathanmarz14:09:11

if you change filterer to selected? it should work

nathanmarz14:09:29

and you don't need to wrap the subpath in []

vikeri14:09:00

@nathanmarz Great! Thanks! Maybe worth collecting these simple examples somewhere?

nathanmarz14:09:31

there's examples on the wiki and the readme

nathanmarz14:09:47

though I agree that the current docs are pretty sparse and disorganized

nathanmarz15:09:07

ideally there would be something like 4clojure but for specter, unfortunately I don't have the time to put that together

vikeri15:09:20

Yeah I skimmed through the ones on the readme and the wiki but couldn’t find my use case. Since it’s quite a powerful abstraction I think some people might need some more examples to grok it.