Open izaid opened 8 years ago
Okay, so my understanding from talking to @shashi is that this should work. I've been debugging it a bit, and the problem seems to lie with this line https://github.com/shashi/Escher.jl/blob/master/src/cli/serve.jl#L119 being used wrongly when there are nested signals -- I can see differences in the diffs there. No fix yet.
Partial progress: That line is indeed the problem. It is diffing against Escher.empty at each recursion, whereas it should diff against the last rendering. I've fixed that up with a global dict. This prevents the duplication of widgets, but it leaves the signals not functioning. :/
I have made the fix where it won't create a new slider. But for some reason, when things get redrawn the watch-states
listeners do not get set up. So when the checkbox is checked for the first time, the slider stops working
Any idea why that is?
Okay, so I have a question about how to modularize signals. Consider the following code:
This simply shows the status of a slider and a checkbox, and it works fine. Now what about the following:
I'd imagine this would do the same thing, but instead I get weird effects like duplication of all the widgets. Is this supposed to work? If not, how can I separate the
ch
andsl
signals?Of course, this is a toy example -- in a real example, I want to do some complicated computation involving the value from one of the signals, or I simply want to modularize one of the signals in a function so that users can call that function but not need to put it in the map.