This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-26
Channels
- # aws-lambda (1)
- # beginners (71)
- # boot (70)
- # bristol-clojurians (1)
- # cider (2)
- # clara (13)
- # cljs-dev (96)
- # cljsjs (6)
- # cljsrn (5)
- # clojure (74)
- # clojure-android (3)
- # clojure-austin (4)
- # clojure-dev (10)
- # clojure-russia (6)
- # clojure-spec (28)
- # clojure-uk (128)
- # clojurescript (64)
- # cursive (2)
- # datascript (18)
- # datomic (116)
- # dirac (1)
- # emacs (12)
- # events (10)
- # hoplon (109)
- # jobs (1)
- # jobs-discuss (21)
- # leiningen (2)
- # luminus (6)
- # off-topic (19)
- # om (21)
- # om-next (5)
- # onyx (4)
- # parinfer (29)
- # perun (20)
- # re-frame (53)
- # reagent (21)
- # remote-jobs (5)
- # ring-swagger (2)
- # spacemacs (6)
- # untangled (42)
- # vim (5)
@piotr2b thank you very much for spending your valuable time on that. i am ok with that.
The following example might seem a bit contrived, but it results in a Warning: Every element in a seq should have a unique :key...
(def some-list
'("here " [:a {:href "#"} "a link"] " and some text"))
(defn example []
[:div
(for [x (range 1 3)] ^{:key x}
(into [:div] some-list))])
I have resolved the warning in other cases, but with this I'm stuck.Thanks @gadfly361 they are good names
@branch14, the metadata is misplaced
try using a regular prop instead
(into [:div {:keys x}] ...)
@pesterhazy Thx. It works if I use :key
instead of :keys
. I didn't realize that it was complaining about the :div
not having a key, since the error message was about the content of some-list
. Confusing.
ah yes that was a typo
the metadata syntax is confusing and should be avoided IMO
so my understanding of track is somewhat challenged
I see basically the tracked function is called every time the atom it depends on is changed
and I don't understand how/when the caching (if any) happens
scratch the above, I just solved by using a cursor in my tracked functions
@richiardiandrea what's unclear about r/track's caching?
no basically it does not cache on the input (and why it would)
by input I mean a derefed atom
you need a cursor that points to your data
but that's solved now
I was deref-ing the whole app-state
a cursor would only limit cache invalidations right?
yes the caching is on the output of track though, this was the point I was missing, a bit spoiled from re-frame
subscriptions 😄