svelte-ch5-stores
v0.1.3
Published
[![npm version](https://img.shields.io/npm/v/svelte-ch5-stores.svg)](https://www.npmjs.com/package/svelte-ch5-stores) [![license](https://img.shields.io/npm/l/svelte-ch5-stores.svg)](LICENSE)
Downloads
6
Readme
svelte-ch5-stores
Purpose
This was designed to allow Crestron CH5 touch panels to use Svelte.
Usage
Write-only example
<script>
import { booleans } from "svelte-ch5-stores/store";
let pressStore = booleans.get("47");
function press() {
$pressStore = true;
}
function release() {
$pressStore = false;
}
</script>
<button
on:pointerdown={press}
on:pointerup={release}
on:pointerout={release}>
<slot />
</button>
Read-only exmaple
<script>
import { numbers } from "svelte-ch5-stores/store";
let sizeStore = numbers.get("93");
</script>
<div>
{#each { length: $sizeStore } as _, index}
<slot />
{/each}
</div>