Skip to content

Fix ESLint violation #19

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

Merged
merged 1 commit into from
May 4, 2021
Merged

Fix ESLint violation #19

merged 1 commit into from
May 4, 2021

Conversation

koddsson
Copy link
Contributor

Use the connectedCallback function instead of a constructor.

For Custom Elements, the constructor method can be a little unwieldy to use; it is called as soon as the class is instantiated with document.createElement which will be before the element has been appended to the DOM. It can be simpler to put code within the connectedCallback which is fired when the element has been appended into the DOM.

https://github.com/github/eslint-plugin-custom-elements/blob/main/docs/rules/no-constructor.md

@koddsson koddsson requested a review from a team as a code owner April 30, 2021 16:07
@koddsson koddsson requested review from smockle and manuelpuyol April 30, 2021 16:07
@koddsson koddsson merged commit 51e801b into main May 4, 2021
@koddsson koddsson deleted the fix-eslint-violation branch May 4, 2021 09:17
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.

2 participants