This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-03
Channels
- # beginners (98)
- # boot (18)
- # chestnut (2)
- # cider (90)
- # cljdoc (3)
- # cljs-dev (1)
- # clojure (64)
- # clojure-dev (14)
- # clojure-dusseldorf (4)
- # clojure-italy (11)
- # clojure-nl (5)
- # clojure-spec (9)
- # clojure-uk (69)
- # clojurescript (63)
- # code-reviews (2)
- # core-logic (20)
- # cursive (13)
- # datomic (52)
- # dirac (2)
- # emacs (4)
- # figwheel (6)
- # hyperfiddle (13)
- # luminus (4)
- # nrepl (1)
- # off-topic (7)
- # onyx (9)
- # overtone (3)
- # parinfer (3)
- # pedestal (1)
- # re-frame (31)
- # reagent (74)
- # reitit (34)
- # rum (3)
- # shadow-cljs (51)
- # spacemacs (22)
- # specter (7)
- # tools-deps (23)
- # uncomplicate (3)
- # vim (9)
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)]))
@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