aktion-runtime 0.5.1 → 0.5.2
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/README.md +6 -3
- package/dist/aktion.iife.js +19 -19
- package/dist/aktion.iife.js.map +1 -1
- package/dist/aktion.js +214 -187
- package/dist/aktion.js.map +1 -1
- package/dist/aktion.umd.cjs +19 -19
- package/dist/aktion.umd.cjs.map +1 -1
- package/dist/types/renderer/renderer.d.ts +7 -3
- package/dist/types/runtime/effects.d.ts +2 -2
- package/dist/types/runtime/evaluator.d.ts +25 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -340,7 +340,7 @@ shell before the leaves arrive.
|
|
|
340
340
|
$count = 0
|
|
341
341
|
$theme = "dark"
|
|
342
342
|
|
|
343
|
-
component Counter(label
|
|
343
|
+
component Counter(label: "Count") {
|
|
344
344
|
return Stack([
|
|
345
345
|
SectionHeader(label),
|
|
346
346
|
Button("Inc", onClick: () => $count = $count + 1),
|
|
@@ -377,9 +377,12 @@ _app_ = pages
|
|
|
377
377
|
- `$name = value` — reactive state. One kind. Read or write with the
|
|
378
378
|
same sigil. Inside `action` / `effect` / lambda bodies, assignment
|
|
379
379
|
operators (`= += -= *= /= ??= ++ --`) are all allowed.
|
|
380
|
-
- `component Name(p
|
|
380
|
+
- `component Name(p: default) { return Expression }` — first-class
|
|
381
381
|
declarations with default expressions, lexical scope, and per-instance
|
|
382
|
-
state.
|
|
382
|
+
state. Inside the body, `$x = expr` is a **declaration**: the
|
|
383
|
+
initializer runs once when the instance first mounts, and re-renders
|
|
384
|
+
preserve whatever value the user (or an action / effect) has written.
|
|
385
|
+
**Always** end with an explicit `return`.
|
|
383
386
|
- `action Name(args) { body }` — callable effects with optional
|
|
384
387
|
`return`. Used as event handlers (`onClick: save`) or as expressions
|
|
385
388
|
(`$result = greet("Ada")`).
|