JSPM

  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q50804F
  • 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

fritz

A library for rendering custom elements in a web worker.

worker.js

import { Component, h } from 'fritz';

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

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

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

index.html

<!doctype html>

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

<script src="../node_modules/fritz/window.umd.js"></script>
<script>
  fritz.use(new Worker("./worker.js"));
</script>

Install

yarn add fritz

License

BSD 2 Clause