Application timers

luastra/timer

Schedules cancellable one-shot application deadlines identified by stable strings. Expiry enters app.handle as a timer event, allowing ordinary state transitions and a following render without exposing a platform timer object.

Start or restart a timer after a state change, handle only the expected ID, and cancel it when the owning workflow ends.

Use Motion.wait for a visual pause inside one animation channel; use Timer when application logic must run after the delay.

Complete example

local Timer = require("luastra/timer")

Timer.start {
    id = "game/next-card",
    delayMs = 1500,
    value = "reveal-complete",
}

local function handle(action: string, target: string, value: string)
    if action == "timer" and target == "game/next-card" then
        showNextCard(value)
    end
end

Detail pages

Timer.RequestIdTimer.StartOptionsTimer.startTimer.restartTimer.cancel