@litoho/core
v0.1.4
Published
Reactive primitives and the base component layer for Litoho.
Readme
@litoho/core
Reactive primitives and the base component layer for Litoho.
Public API
import {
LitoElement,
ReactiveMixin,
signal,
memo,
watch,
batch,
track,
store
} from "@litoho/core";Quick example
import { html } from "lit";
import { LitoElement, signal, memo } from "@litoho/core";
const count = signal(0);
const doubled = memo(() => count.get() * 2);
class CounterCard extends LitoElement {
protected override createRenderRoot() {
return this;
}
override render() {
return html`
<p>Count: ${count.get()}</p>
<p>Doubled: ${doubled.get()}</p>
<button @click=${() => count.update((value) => value + 1)}>Increment</button>
`;
}
}Docs
- State guide: ../../docs/state.md
- Working example:
playgrounds/demo-state
