How to use the skatejs.name function in skatejs

To help you get started, we’ve selected a few skatejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skatejs / skatejs / site / index.ts View on Github external
import './fills/history';
import { name } from 'skatejs';
import App from './components/app';

const app = name();
customElements.define(app, class extends App {});
document.body.innerHTML = `<${app}>`;
github skatejs / skatejs / packages / renderer-preact / src / index.js View on Github external
function newVnode(vnode) {
  let fn = vnode.nodeName;
  if (fn && fn.prototype instanceof HTMLElement) {
    if (!fn[preactNodeName]) {
      const prefix = fn.name;
      customElements.define(
        (fn[preactNodeName] = name(prefix)),
        class extends fn {}
      );
    }
    vnode.nodeName = fn[preactNodeName];
  }
  return vnode;
}