Skip to content

Instantly share code, notes, and snippets.

@oscarmarina
Created September 5, 2021 09:36
Show Gist options
  • Select an option

  • Save oscarmarina/0eea4c9c9bf2d82b2a01b5fc1180ffcf to your computer and use it in GitHub Desktop.

Select an option

Save oscarmarina/0eea4c9c9bf2d82b2a01b5fc1180ffcf to your computer and use it in GitHub Desktop.
firstUpdated(changedProps) {
super.firstUpdated && super.firstUpdated(changedProps);
this.__slotsDom = Array.from(this.shadowRoot.querySelectorAll('slot')).reduce(
(previous, curren) => {
Object.assign(previous, { [curren.name]: curren.parentNode });
return previous;
},
{},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment