/**
 * The decorators proposal has changed since @babel implemented it. This code will need to change at some point...
 */
export function defineElement(tagName, options) {
    return function decorator(targetClass) {
        Object.defineProperty(targetClass, 'tagName', {
            value: tagName,
            writable: false,
            enumerable: false,
            configurable: false
        });
        
        // Register the tagName as a custom-element with the browser
        window.customElements.define(tagName, targetClass, options); // Define the chosen tagName on the class itself so our vdom.render-function knows what DOM-Element to create
        return targetClass;
    };
}
