@ktt45678/vidstack
Version:
UI component library for building high-quality, accessible video and audio experiences on the web.
22 lines (19 loc) • 455 B
JavaScript
import { render } from 'lit-html';
class LitElement extends HTMLElement {
constructor() {
super(...arguments);
this.rootPart = null;
}
connectedCallback() {
this.rootPart = render(this.render(), this, {
renderBefore: this.firstChild
});
this.rootPart.setConnected(true);
}
disconnectedCallback() {
this.rootPart?.setConnected(false);
this.rootPart = null;
render(null, this);
}
}
export { LitElement };