-
Notifications
You must be signed in to change notification settings - Fork 959
Description
I encountered the following problem with widgets that create sub-widgets from the JavaScript side in their JavaScript model constructor:
For example the gamepad widget creates subwidgets for the buttons and axes in its constructor. Once the connected
trait attribute is set to True, the user may wire things to the gamepad buttons...
However, in the case of a page reload, I would like these widgets not to be replaced by new ones, when the constructor of the JavaScript side is executed. The part of the constructor containing the creation of the children should only occur after the state request resolves.
One way to solve this issue would be to create a model-ready
event for that, of have a certain promise that gets resolved right away in the case of a new model, and after the state request resolves in case of page reload.
Suggestions welcome.