matthewp / fritz

Take your UI off the main thread

Home Page:https://fritz.work/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ezoic increase your site revenue

About

Take your UI off the main thread

https://fritz.work/


Languages

Language:JavaScript 82.2%Language:HTML 14.6%Language:CSS 2.7%Language:Makefile 0.5%