trix icon indicating copy to clipboard operation
trix copied to clipboard

Idempotent Custom Element registration

Open seanpdoyle opened this issue 3 years ago • 0 comments

If the package is accidentally imported a second time, the Custom Element registrations will raise an exception like:

NotSupportedError: Cannot define multiple custom elements with the same tag name

This commit adds a guard that checks whether or not the element has been registered through a call to CustomElementRegistry.get. When present, the redundant call to CustomElementRegistry.define is skipped.

seanpdoyle avatar Aug 05 '22 16:08 seanpdoyle