JSPM

  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q50791F
  • License BSD-2-Clause

Create web components that run in a Web Worker

Package Exports

  • fritz

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fritz) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm version

fritz

A library for rendering custom elements in a web worker.

worker.js

import { Component, html } from 'fritz';

class Hello extends Component {
  static get props() {
    return {
      name: { attribute: true }
    }
  }

  render({name}) {
    return html`
      <span>Hello ${name}</span>
    `;
  }
}

fritz.define('x-hello', Hello);

index.html

<!doctype html>

<x-hello name="world"></x-hello>

<script type="module">
  import fritz from 'https://unpkg.com/fritz/window.js';

  fritz.use(new Worker("./worker.js"));
</script>

Install

Yarn

yarn add fritz

npm

npm install fritz

License

BSD 2 Clause