@joist/query
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Query

Allows user to query the light dom or shadow dom (if attached) for

Installation:

npm i @joist/query
const template = document.createElement('template');
template.innerHTML = `
  <input name="fname" />
`;

class MyElement extends HTMLElement {
  @query('input') input!: HTMLInputElement;

  constructor() {
    this.attachShadow({ mode: 'open' });
  }

  connectedCallback() {
    this.shadowRoot!.appendChild(template.content.clone(true));
  }
}

Package Sidebar

Install

npm i @joist/query

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

5.27 kB

Total Files

11

Last publish

Collaborators

  • deebloo