Thing through this some more, here are some refinements:
-
ES6 module format!
-
Module should expose an
async
initialize
API that internally loads the GUI up and preps it for use -
Exposing
update
methods as observers - perhaps we generateObserver
functions that can subscribe toObservables
producing updated values for the control. Ifset
accessors 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