apologies for the newbie questions. I have an issue here where I need to track both input1 and input2 but I do not want the main_pane called twice when the pane is rendered, which is the current behavior, but only once for a change in a set of inputs. This is an issue for me because the main_pane will start a callback for a fast refresh, and if my number of inputs grows, there will be a callback created for each input, instead of just one being created for the whole set of inputs. Is there a way to achieve this behavior?
In the code below you can see that if you change any of the inputs, the num_of_calls increments by 2 instead of 1.
Cheers @Hoxbro - this worked. Out of curiosity, why is it so? If you donāt mind explaining please. Iāve been struggling to sort this out for a day so quite pleased with the approach, but would be nice to know what is different here.
Panel by default runs code eagerly and somewhere in the template pn.panel (or similar) is run. By setting pn.panel(..., lazy=True) the template skips running pn.panel and by setting lazy=True runs it lazily.
For me, it also happens with lazy=False and not using --admin in panel serve, though Iām running on the master branch.
So it only seems to work when I have --admin turned on. Honestly, I donāt know if this is a design decision or a bug. It makes sense that you only track users when running in āadmin modeā.