Normally when using js classes, I pass in any configuration data needed at instantiation, through the constructor. This can't be done with custom elements. Of course I've thought about just passing in the required data with every method call, but this gets very messy quickly. I'd rather wire everything up to expect a config object where needed, and then just call functions without input. The next obvious solution is to use a global object that each class can access and use to configure method calls on the fly. Of course, this has the huge downside of requiring a global object.
What I'm wondering is if there is a clean approach to setting up custom element code this way that I'm missing.
It would be fantastic if one could pass in arguments as part of the 3rd/"options" parameter when defining the element initially, which could then be made available in the constructor.
I guess I'll just write a factory wrapper class and roll my own constructor functionality for now...