Create web components that run in a Web Worker


Keywords
web-components, webcomponents, react, virtualdom, web-worker
License
BSD-2-Clause
Install
npm install fritz@5.0.0-beta.5

Documentation

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