Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the static LumeElement.defineElement() method #29

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

trusktr
Copy link
Member

@trusktr trusktr commented Sep 20, 2024

Improve the static LumeElement.defineElement() method so that it returns the same class if the class is not already used with an existing element name.

BREAKING: If you relied on the return value always being a new class, now the value may be the same class if the element is not yet defined. If you really need the previous behavior, you can change something like this,

class SomeEl extends Element {...}

const NewEl = SomeEl.defineElement('new-el')

to this,

class SomeEl extends Element {...}

class NewEl extends SomeEl {}
NewEl.defineElement('new-el')

…turns the same class if the class is not already used with an existing element name
@trusktr trusktr merged commit e474ad0 into main Sep 20, 2024
0 of 3 checks passed
@trusktr trusktr deleted the improve-defineElement-method branch September 20, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant