This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-22
Channels
- # announcements (21)
- # aws (7)
- # beginners (105)
- # berlin (1)
- # calva (14)
- # cider (20)
- # clj-kondo (62)
- # cljdoc (7)
- # cljsrn (1)
- # clojure (206)
- # clojure-dev (2)
- # clojure-europe (11)
- # clojure-france (2)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-uk (34)
- # clojured (1)
- # clojurescript (52)
- # copenhagen-clojurians (2)
- # core-async (1)
- # cryogen (3)
- # cursive (36)
- # data-science (27)
- # datomic (48)
- # emacs (1)
- # events (1)
- # fulcro (27)
- # hoplon (51)
- # jobs-discuss (1)
- # leiningen (1)
- # nrepl (2)
- # off-topic (52)
- # pathom (43)
- # quil (10)
- # re-frame (11)
- # reitit (28)
- # remote-jobs (2)
- # shadow-cljs (36)
- # sql (12)
- # tools-deps (7)
- # vim (32)
- # xtdb (17)
Does anyone know of a way to emit warnings if re-frame dispatches happen during a reagent component's render fn?
@kristian507 May be possible if you make your own function that wraps dispatch, then check this dynamic variable: https://github.com/reagent-project/reagent/blob/bd8603dce8e675fd4fe4f8c841c4369e4e39421d/src/reagent/impl/component.cljs#L11
Thanks! If only there was a pre-event callback in re-frame, I could do it without a custom dispatch function
An issue with that - event handlers are evaluated after a goog.async.nextTick
, so the component will be finished rendering. It would work for dispatch-sync
though.
yeah, I don't see any way to avoid a custom dispatch function that checks (r/current-component)
Interesting, though it sounds like you wanted a warning when the event is queued for processing, no? (what dispatch will do) Is there a hook for that? Important, because the event will be processed asynchronously unless you use dispatch-sync, so that dynamic var won't hold the same value