UNPKG

@ou-imdt/utils

Version:

Utility library for interactive media development

11 lines 479 B
/** * Defines a custom HTML element if it hasn't been defined already. * @param {string} tag - The tag name of the custom element. * @param {Function} constructor - The constructor function for the custom element. * @param {ElementDefinitionOptions} [options] - Additional options for the custom element. */ export default function defineCustomElement(tag, constructor, options) { if (!customElements.get(tag)) { customElements.define(tag, constructor, options); } }