fritz
4.0.1 • Public • Published
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
npm
License
BSD 2 Clause
Package Sidebar
Install
Weekly Downloads