This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-10
Channels
- # announcements (5)
- # aws (18)
- # babashka (1)
- # beginners (81)
- # calva (7)
- # chlorine-clover (1)
- # cider (5)
- # cljs-dev (8)
- # clojure (125)
- # clojure-dev (1)
- # clojure-europe (31)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-norway (1)
- # clojure-spec (5)
- # clojure-sweden (1)
- # clojure-uk (31)
- # clojurescript (85)
- # code-reviews (1)
- # core-async (17)
- # cursive (39)
- # datomic (16)
- # emacs (1)
- # fulcro (6)
- # java (16)
- # kaocha (2)
- # luminus (4)
- # malli (2)
- # off-topic (65)
- # pathom (3)
- # re-frame (11)
- # reagent (5)
- # remote-jobs (1)
- # rum (5)
- # sci (10)
- # shadow-cljs (24)
- # spacemacs (4)
- # test-check (3)
- # tools-deps (22)
- # xtdb (15)
Hello, is the second subscription supposed to trigger a cache hit in that example?
(with-let [a @(subscribe [:a])] (finally (with-let [b @(subscribe [:a])]))
@quentin.leguennec1
re-frame-10x
provides some information about subscription dynamics
You haven't really provided enough information to answer your second question. I guess the general answer is that cache hits will occur if the subscription already exists, and not otherwise.
@mikethompson thanks, I'll look into it. Well shouldn't the cache be updated as soon as @(subscribe [:a])
is run?
oh sorry, I the code was actually wrong, I will edit it
the first binding of the second with-let is actually a subscription to :a
A bit unrelated - I'm not sure about using with-let
inside the finally
block. I may be wrong, but it sounds like a potential way to create leaks.
By potentially not calling dispose!
. Better to ask in #reagent about using reactions in finally
.
Either way, if you're not sure why you need with-let
in particular inside finally
, then probably you need just let
.
oh yeah, you mean the inner with-let
. Well I think dispose!
is called anyway, even with no finally
` . That's what I understood at least, I'm not sure. I agree that
I agree that let
would work, though