fritz

4.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i fritz

    Homepage

    fritz.work

    Weekly Downloads

    7

    Version

    4.0.1

    License

    BSD-2-Clause

    Unpacked Size

    62.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • matthewp