Class: ElementSk

infra-sk/modules/ElementSk.ElementSk(templateopt)

A base class that records the connected status of the element in this._connected and provides a _render() function that doesn't do anything this this._connected is false.

Constructor

new ElementSk(templateopt)

Parameters:
Name Type Attributes Default Description
template TemplateResult <optional>
null A lit-html template to be used in _render.
Properties:
Name Type Description
_connected Boolean True if the connectedCallback has been called.
Source:
Example
class MyElement extends ElementSk {
  constructor() {
    super();
    this._template = (ele) => html`<p>Hello World!</p>`;
  }

  connectedCallback() {
    super.connectedCallback();
    this._render();
  }
}

Methods

_render()

Renders the lit-html template found at this._template if not-null, but only if connectedCallback has been called.
Source:

_upgradeProperty()

Capture the value from the unupgraded instance and delete the property so it does not shadow the custom element's own property setter. See this Google Developers article for more details.
Source: