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 CHANGED
@@ -340,7 +340,7 @@ shell before the leaves arrive.
340
340
  $count = 0
341
341
  $theme = "dark"
342
342
 
343
- component Counter(label = "Count") {
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 = default) { return Expression }` — first-class
380
+ - `component Name(p: default) { return Expression }` — first-class
381
381
  declarations with default expressions, lexical scope, and per-instance
382
- state. **Always** end with an explicit `return`.
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")`).