Fork me on GitHub
#reagent
<
2022-02-09
>
Aspirational17:02:43

Hi! How can it be that when my form 2 component depends on ratom it got rerendered, but when it depends on ratom/make-reaction (I need it's :on-dispose feature) component does not rerendered...cant figure it out.

p-himik17:02:55

Shouldn't be the case. In the form-2 component, do you deref them in the inner function or the outer one?

Aspirational18:02:44

minimal example when i use make-some-state - low-level-component got rerendered but with make-some-state* - is not

p-himik18:02:18

The picture is not yet complete. The code has nothing that should lead to a re-render - do you change the value of reg-state anywhere? BTW not important, but that doall is not needed.

p-himik18:02:05

This example also doesn't seem to be that minimal - it has an extra atom and a ratom that don't seem to be important at all. It also switches between JS and CLJS data structures. Or can you not reproduce the behavior if you remove any or those things?

Aspirational18:02:53

yeah, ret-state got updates from external JS lib firebase-like, ret-state takes new values from server ( db ) p.s. irl its more complex and doall is needed,

Aspirational18:02:44

rerenderindg triggers by swaping\reseting the ret-state from external handler which got updates from that JS db

Aspirational18:02:37

But it only matters that in the first case (subscribing directly to ratom) everything works, but in the second case (with make-reaction) it does not.

Aspirational18:02:10

I know that I can use r/with-let in component and use (finally) but it entails some boilerplate

p-himik19:02:07

If you can create a proper self-contained MRE, I'd be willing to debug it.