This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-18
Channels
- # beginners (84)
- # boot (21)
- # cider (12)
- # cljs-dev (13)
- # cljsrn (3)
- # clojure (169)
- # clojure-dusseldorf (2)
- # clojure-gamedev (6)
- # clojure-germany (1)
- # clojure-russia (15)
- # clojure-serbia (4)
- # clojure-spec (16)
- # clojure-uk (4)
- # clojurescript (51)
- # core-async (1)
- # datomic (23)
- # emacs (16)
- # figwheel (1)
- # fulcro (60)
- # hoplon (8)
- # lein-figwheel (3)
- # leiningen (1)
- # luminus (4)
- # lumo (43)
- # off-topic (4)
- # re-frame (17)
- # rum (37)
- # shadow-cljs (21)
- # test-check (13)
- # vim (14)
I'm a little puzzled. I have a key-value map in my db which I offer a subscription for. But the subscription (a very simple (reg-sub :foo (fn [db] (:foo db)))
) is returning a sequence of the values, not the map. What am I missing?
My guess is that :foo
is not what you think it is :-)
Because everything else about the subscription looks right
@mikethompson (type (:actors @re-frame.db/app-db))
=> cljs.core/PersistentHashMap
, (type @(re-frame.core/subscribe [:actors]))
=> cljs.core/ValSeq
@mikethompson (re-frame/reg-sub :actors (fn [db] (:actors db)))
Sorry, can't see any obvious problem
the problem is that my dereferenced subscription is a sequence of the values of the map, not the map
You are sure you haven't over ridden the definition or are seeing old code
Sometimes when I get weird stuff like that I have to lein clean and start over
@danieleneal damnit, you are dead right thank you.
@mikethompson sorry, front-of-screen problem here
somehow i decided to also add a second subscription with the same name later that used (vals :actors)
i would never have thought to look for it without prompting because i would have assumed I wasn't that stupid!
We've all been there 😁