This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-05
Channels
- # announcements (14)
- # babashka (51)
- # beginners (154)
- # calva (24)
- # cider (4)
- # clj-kondo (24)
- # cljfx (11)
- # cljs-dev (3)
- # clojure (259)
- # clojure-europe (14)
- # clojure-nl (2)
- # clojure-seattle (8)
- # clojure-spec (6)
- # clojure-taiwan (1)
- # clojure-uk (52)
- # clojurescript (123)
- # conjure (43)
- # core-async (15)
- # datomic (14)
- # events (1)
- # fulcro (90)
- # helix (7)
- # jobs (6)
- # meander (10)
- # nrepl (1)
- # off-topic (13)
- # pathom (1)
- # portal (8)
- # re-frame (7)
- # reveal (11)
- # shadow-cljs (99)
- # spacemacs (11)
- # testing (11)
- # vim (63)
I was wondering what happens if one subscribes from within a callback function i.e. on-click? Are any of the four subscription layers compromised at all?
It's somewhere in the FAQ I believe. It will create a leak since the subs will be cached but will never be pruned.
My bad - not yet: https://github.com/day8/re-frame/pull/565
I guess I don’t get the “it might not be freed”. It seems the mem leak happens by chance not for sure
If the sub is also used in a view, then it will be freed when the view is unmounted. If the sub is not used in any view, there will be a leak.
@lucio The subscribe
and the subsequent dereference should happen in the render phase. Not much later when an on-click
handler is called.