Hyper Open Edge Cloud

Never call changeState of an external gadget

  • Last Update:2020-06-05
  • Version:001
  • Language:en

Never call changeState of an external gadget

changeState is supposed to be a private method to manage the gadget state internally.

Instead, gadgets are supposed to provide an explicit API (with .declareMethod) usable from external gadget.

Good example:

return this.changeState({});

Bad example:

return this.getDeclaredGadget('random')
  .push(function (gadget) {
    return gadget.changeState({});
  });