Store & StoredValue
Guide: State.
Store(T) — field-grained reactive struct
| Export | Signature |
|---|---|
createStore / Store(T).create | (comptime T, owner, initial: T) !*Store(T) |
| Method | Notes |
|---|---|
get(comptime field) FieldType | reactive read of one field |
peek(comptime field) FieldType | untracked |
set(comptime field, value) void | notifies that field's subscribers only |
One signal per struct field, generated at comptime — cross-field updates never cause unrelated re-runs.
StoredValue(T) — non-reactive cell
| Member | Signature |
|---|---|
StoredValue(T).create | (comptime T, owner, initial) !*StoredValue(T) |
get() T / getPtr() *T / set(v) void | plain access, no notifications |
Lives exactly as long as its owner; disposed with the scope.
Chunk-side persistence
verve.storage (localStorage): set(key, value), get(key, buf) []const u8, len(key) u32, remove(key).