Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matthewp/fritz

Take your UI off the main thread
https://github.com/matthewp/fritz

framework javascript webcomponents workers

Last synced: 26 days ago
JSON representation

Take your UI off the main thread

Awesome Lists containing this project

README

        

# fritz

A library for rendering custom elements in a web worker.

**worker.js**

```js
import { Component, h } from 'fritz';

class Hello extends Component {
static get props() {
return {
name: { attribute: true }
}
}

render({name}) {
return (
Hello {name}
);
}
}

fritz.define('x-hello', Hello);
```

**index.html**

```html

My App

import fritz from '//unpkg.com/fritz@next/window.js';

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

```

## Install

Using [Yarn](https://yarnpkg.com/en/):

```shell
yarn add fritz
```

Using npm:

```shell
npm install fritz
```

## License

BSD 2 Clause