store
A store over initial, which it wraps rather than copies: every path is a
signal. A read inside JSX (item.liked) follows that path alone, and a
write through the store (items[3].liked = true, items.push(next))
updates only the bindings that read what changed. Made while a component
sets up, it belongs to that component's slot, as signal() does.
Usage
Render a short checklist
import { For, Scroll, Text, store } from 'kuito';
export function PackingList() {
const state = store({ items: [{ title: 'Passport' }, { title: 'Tickets' }] });
return (
<Scroll>
<For each={state.items} fallback={<Text>Add your first item</Text>}>
{(item, index) => <Text padding={12}>{`${index.value + 1}. ${item.title}`}</Text>}
</For>
</Scroll>
);
}Signatures
<T extends object>(initial: T, name?: string): TType parameters
| Name | Constraint | Default |
|---|---|---|
T | object | — |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
initial | T | Yes | — |
name | string | No | — |
Returns
T
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.