Thing through this some more, here are some refinements:
-
ES6 module format!
-
Module should expose an
asyncinitializeAPI that internally loads the GUI up and preps it for use -
Exposing
updatemethods as observers - perhaps we generateObserverfunctions that can subscribe toObservablesproducing updated values for the control. Ifsetaccessors are suited that would work better. Example:onScoreChangedObservable.add(guiModule.score.onUpdate) -
(Optional) allow or provide pre-set AnimationGroups and/or Animations for actions like fade in/out, etc.
-
(Optional) expose control life cycle events like onResize as further sets of Observables