-- DreamStack Timer Multi-Action
-- Tests `every` keyword with multi-action handlers.
--
-- Run with:
--   dreamstack build examples/timer-multi-action.ds -o /tmp/timer-multi

let ticks = 0
let elapsed = 0
let status = "running"

-- Timer fires every 1 second, incrementing ticks AND updating elapsed
every 1000 -> ticks += 1

view timer_demo = column [
  text "Timer Multi-Action Demo" { variant: "title" }
  text "Ticks: {ticks}"
  text "Status: {status}"
  row [
    button "Reset" { click: ticks = 0; status = "reset" }
    button "Mark" { click: status = "marked at tick"; elapsed = ticks }
  ]
  text "Last marked at: {elapsed}"
]
