This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-11
Channels
- # announcements (4)
- # babashka (4)
- # beginners (164)
- # calva (47)
- # cider (1)
- # cljs-dev (29)
- # cljsrn (3)
- # clojure (137)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (44)
- # clojurescript (35)
- # component (8)
- # conjure (119)
- # cursive (32)
- # datomic (12)
- # emacs (31)
- # figwheel-main (36)
- # graalvm (10)
- # jobs (2)
- # kaocha (1)
- # lein-figwheel (3)
- # meander (15)
- # mount (3)
- # off-topic (9)
- # pathom (8)
- # quil (4)
- # re-frame (13)
- # reagent (15)
- # remote-jobs (10)
- # shadow-cljs (128)
- # slack-help (2)
- # spacemacs (8)
- # test-check (6)
- # xtdb (6)
re-frisk 1.3.2 with cached subscriptions and fix for subscriptions dispose https://github.com/flexsurfer/re-frisk
Quick re-frame question: where a subscription is dereferenced matters in terms of performance, right? i.e.
(defn my-component [s] [:div @s])
;; this function is the "view" that gets rendered and may contain many components
(defn my-panel []
[:<>
[my-component (rf/subscribe [::subs/my-sub])]])
is preferred over
;; now only immutable data gets passed in
(defn my-component [s] [:div s])
;; this function is the "view" that gets rendered and may contain many components
(defn my-panel []
[:<>
[my-component @(rf/subscribe [::subs/my-sub])]]))
?i would say yes, i'm old school so I always create subs like this
(defn my-component []
(let [s (rf/subscribe [::subs/my-sub])]
(fn []
[:div @s])))
;; this function is the "view" that gets rendered and may contain many components
(defn my-panel []
[:<>
[my-component]])
In the case where the data is deref'd before being passed to the component, right?
Thanks 👍
subscribe outside renderer and deref inside renderer , that's ,my rule 🙂 (edited: but not for others, because of cache)
Gotcha
in my projects i use this defview macro ,so I don't need to think about deref at all https://github.com/flexsurfer/re-frame-steroid#usage
Hi I have a circular dependency error while trying to change the active-page in my app There is an event a in namespace A (related to active page A) that need to call on API success when the active page is B and also There is an event b in namespace B (related to active page B) that need to call on API fail when the active page is A Is there any other solution except refactoring?