/fritz

Take your UI off the main thread

Primary LanguageJavaScript

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>
<html lang="en">
<title>My App</title>

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

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

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

Install

Using Yarn:

yarn add fritz

Using npm:

npm install fritz

License

BSD 2 Clause