This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-21
Channels
- # announcements (6)
- # bangalore-clj (1)
- # beginners (46)
- # cider (21)
- # cljs-dev (30)
- # cljsjs (3)
- # clojure (131)
- # clojure-dev (20)
- # clojure-europe (2)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-russia (4)
- # clojure-spec (55)
- # clojure-uk (57)
- # clojurebridge (1)
- # clojured (1)
- # clojurescript (55)
- # cursive (11)
- # data-science (1)
- # datomic (23)
- # duct (1)
- # emacs (1)
- # events (1)
- # figwheel-main (2)
- # fulcro (219)
- # graphql (16)
- # immutant (1)
- # jackdaw (3)
- # java (6)
- # juxt (30)
- # kaocha (8)
- # mount (3)
- # nyc (1)
- # off-topic (16)
- # pathom (48)
- # pedestal (1)
- # re-frame (71)
- # reagent (17)
- # ring-swagger (3)
- # shadow-cljs (96)
- # spacemacs (21)
- # specter (8)
- # speculative (20)
- # sql (21)
- # test-check (2)
- # tools-deps (12)
- # vim (6)
So you are saying you see:
1. (.log js/console "router @" r)
fires
2. You do not see a transition from home/page
to [:div "Page 2"]
If yes, my next question will be "what is home/page
?"
no @mikethompson, i see the log messages fire for either of the subscription methods, but not the router's log message
Ah, right
So (.log js/console "result 2" result)
shows a different value to the last time
BTW, are you using re-frame-10x
?
So re-frame-10x
should show that the subscriptions have re-run and also show you that a different values has been delivered in each case?
I'm just checking to make sure the subscription actually delivers a new value. It may run ... but if it delivers the same value as before, then there's no need for the view to rerender
So that would be my first check.
No, i believe you.
I'm a bit stumped.
Can't think of a different reason why there'd be no rerender
i also implemented a simple counter, with a button that increments the count, and that worked perfectly fine
Hmm. So in summary:
1. @(rf/subscribe [:active-panel-name])
returns a different value but ...
2. A renderer which uses that subscription does not rerender.
Click on "diffs" check box in subscriptions to be sure there are really different values
I saw images for a short time
So ... what you are doing is right. But if you were doing it right, then it would work. So we are being tricked somehow. But I can't work it out
Worse, I have to go.
That's certainly a change !!
:about
is not in your case
Which makes me wonder what (get-in active-panel [:data :name])
returns
could be a nil
?
Grasping at straws
Are you sure router
is actually rendered?
Perhaps there's a different view function
And you are staring at the wrong one
More grasping at straws
not sure what it means, but i was just looking through the traces in re-frame-10x, and i see some :sub/dispose
s at the end
This is bugging me. Can you change your case so instead of
(case r
:home home/page
...
you have
(case r
:home [home/page]
I can't remember what you said home/page
was
So I'm guessing here
So explanation: If a renderer ever returns a function, then that function will be made the new renderer
Replacing the existing renderer for that component
That is how Form-2 components work
no problem
onward
when making a reusable component, which approach is best: (1) deref the subscription in the parent and pass pure data to the component (2) pass the name of the subcription and have the component subscribe to it
@mateus.pimentel.w we use Vega and VegaLite. See https://github.com/metasoarous/oz
@stathissideris path 2 is probably better. because path 1 will cause an unnecessary rerender of the parent when the subscription changes.
@mikethompson ok, but I guess (1) is ok if the parent was going to be re-rendered anyway. Thanks!
@stathissideris Overall, our general rule is to create subscription as close as possible to their use. On the other hand path 1 can make some kinds of testing easier.
Because the child is more of a pure function
(Not that you are suggesting this but ...) One thing that we have found ends badly is passing subscriptions themselves from a parent to the child.
I haven’t tried that last one because I saw no documentation suggesting that it would work. I usually just pass the keyword.