Quentin Le Guennec 2020-07-10T07:57:58.385Z

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.

Quentin Le Guennec 2020-07-10T13:14:37.388500Z

@mikethompson thanks, I'll look into it. Well shouldn't the cache be updated as soon as @(subscribe [:a]) is run?

Quentin Le Guennec 2020-07-10T13:16:27.389Z

oh sorry, I the code was actually wrong, I will edit it

Quentin Le Guennec 2020-07-10T13:17:12.389700Z

the first binding of the second with-let is actually a subscription to :a

p-himik 2020-07-10T13:26:10.390600Z

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.

Quentin Le Guennec 2020-07-10T13:26:42.390800Z


p-himik 2020-07-10T13:46:42.390900Z

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.

Quentin Le Guennec 2020-07-10T13:48:48.391100Z

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

Quentin Le Guennec 2020-07-10T13:48:55.391300Z

I agree that let would work, though