So I'm pretty new to Specter, but I'm trying to navigate a vector like [{:id 1, :value 2} {:id 2, :value 1}]
by :id
. (I know that this would be ideally a map, but it's not for now.) [MAP-VALS #(= x (:id %))]
seems to work, but how do I define a navigator so that it's reusable?
Is this the right way to do it?
(defn by-id [id] (specter/path [specter/MAP-VALS #(= (:id %) id)]))
uh, that should be ALL
, not MAP-VALS
@miikka yes, that's exactly right
anyone have an idea why I'd be getting this error in 1.1.1 but not 1.1.0?
WARNING: Use of undeclared Var cljs.core/MapEntry at line 84 /home/kevin/.boot/cache/tmp/home/kevin/0work/jbog/guardian-dashboard/cul/v9pufs/index.html.out/com/rpl/specter/navs.cljc
I just erased .boot/cache and recompiled and the same error is there@vigilancetech that's related to a change in ClojureScript 1.10
you should upgrade your cljs