create-muten 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -167,6 +167,14 @@ Button "Next" -> next
|
|
|
167
167
|
```
|
|
168
168
|
Pass as many params as you need (`q`, `page`, `sort`, `category`, …). The query's `.loading`/`.error` reflect the refetch.
|
|
169
169
|
|
|
170
|
+
**Live data — `every Ns` (auto-refresh)** — append `every <duration>` to a query to poll it on a timer (`5s`, `500ms`, `2m`). The background refetch is **silent** (no loading flash) and rendering is **keyed by id**, so only the rows whose data actually changed re-render — fine for live dashboards / stats / prices, even with large lists:
|
|
171
|
+
```
|
|
172
|
+
state { prices = query prices every 5s : list<Price> }
|
|
173
|
+
sources { prices: { url: "/prices", at: "data" } }
|
|
174
|
+
# each prices.data as p { Text "{p.symbol} {p.value}" } — only changed rows update, focus/scroll survive
|
|
175
|
+
```
|
|
176
|
+
Client-side only (deploy via `vite build`; static `muten build` pages don't poll). Use `refetch` for user-driven refresh, `every` for background refresh.
|
|
177
|
+
|
|
170
178
|
**Escape hatch — explicit request** (when the API isn't RESTful): `post`/`put`/`delete` a `"client:/path"` (interpolated) with an optional `body`, in an action:
|
|
171
179
|
```
|
|
172
180
|
action buy <- item { post "shop:/orders" body item } # any method, any path
|