Fork me on GitHub
#reagent
<
2016-01-01
>
adamtrilling13:01:18

I have a n00b question: what determines whether a component is re-rendered when it uses a ratom that is updated? I’m working on a little “I want to learn how this works” project before I embark on a real side project and I’m probably missing something stupid.

adamtrilling13:01:22

My code looks sorta like this:

adamtrilling13:01:49

When I swap! or reset! db, first-component re-renders, but second-component doesn't

adamtrilling13:01:15

(I figured this out by putting a console.log in the inner function of each component)

jaen17:01:22

Hmm, interesting, this looks like both should.

adamtrilling17:01:07

Yeah. I'm fairly certain I'm missing something stupid. But I can't figure out what.

adamtrilling17:01:42

What does it take to get a form-2 component to re-render when a ratom changes value? Do I have to pass in the ratom as an argument? Or can I just dereference it within the function?