aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-26 11:23:52 +0100
committereunhhu <[email protected]>2026-09-26 11:23:52 +0100
commit3b3e4a221fa47d0109c6ab99be65b5ba48bae254 (patch)
treeb589055590c135ef1dad07d7797f7e32b90e39c5 /examples
parentf0a37de5bc9cf924494878e4ab8d3023ddbb27bd (diff)
downloadvega-3b3e4a221fa47d0109c6ab99be65b5ba48bae254.tar.gz
vega-3b3e4a221fa47d0109c6ab99be65b5ba48bae254.zip
Count the open tasks in the todo example
The left field said how many tasks there were; it now says how many are still open, "2 of 3", with aup's count(t in tasks where !t.done), which Pure runs as a fold over the list on every surface. The reference model counts the same, and in the browser the field follows a task marked done.
Diffstat (limited to 'examples')
-rw-r--r--examples/todo.aup2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/todo.aup b/examples/todo.aup
index a5ee3b0..f1e3825 100644
--- a/examples/todo.aup
+++ b/examples/todo.aup
@@ -29,7 +29,7 @@ on urgent.down { at.urgent = !at.urgent }
on drop.down { tasks.remove(at) }
view title = "To do"
-view left = "{tasks.count} tasks"
+view left = "{count(t in tasks where !t.done)} of {tasks.count}"
# A list: label, and optionally tone, badge and detail per row.
view tasks_list = each task in tasks {