Skip to content

onEvent, onStateChange, declareJob, element

Romain Courteaud requested to merge romain/renderjs:wip into master

4 main changes are provided by this merge request.

  1. deprecate getElement method. Access the DOM with the .element property directly
  2. add onEvent service. It simplify the DOM event handler, by no manually writing loopEventListener. The event target will be the gadget event.
  3. add declareJob, which are method with a deferred execution, triggered when the gadget is inside the DOM
  4. add a gadget state property. It can be initialized with the setState class method. Gadget state must be modified with the changeState method, which can trigger an onStateChange callback if a modification has been detected

/cc @cedric.leninivin @vincentB

Merge request reports