I am trying to make some values persistent when going back and forth a multi-tab app (and also across sessions) but I encountering a case in which I would need having multiple callbacks with the same output.
I have 6 colored boxes and I want to let the user change their colors with a color picker. When the user clicks on one of the colored boxes the color picker assumes the color of the box (I have a callback where every box is a State, every n_clicks_timestamp is an Input and the value of the color picker is an Output, also the title of the color picker is an Output so the user knows which box is changing the color of). Then, the user can select a new color: when a new color is chosen the corresponding box changes its color (the value of the color picker is an input and the background color of every box is an Output, to determine which box to update I look at the title of the color picker as a State).
The problem is that if I create a dcc.Store (or hidden div) for saving the colors of the boxes, for example following the approach described here Saving State of Tabs in Dash then I would need to connect the dcc.Store to the boxes with a callback which places the background color of the boxes as Output, but this is illegal since there is another callback with that Output.
So the problem is that the color of the boxes can be changed both by restoring the content of the dcc.Store and both the color picker via the user interaction.
With PyQt, Swift and other languages/frameworks having multiple “callbacks” with the same Output is not a problem. Wouldn’t it be simple to “just” allow that?