Recipe: run a delayed action

luastra/timer · app.handle · about 10 minutes

Start a one-shot timer from a button and update visible state when its event arrives.

You will build a page whose status starts at 0:waiting. Press Start and, after 25 ms, expect 1:next.

This recipe demonstrates the timer exception: start returns an acknowledgement RequestId, but expiry enters app.handle and never app.resolve.

Do not add app.resolve for timer expiry. Timer control acknowledgements are consumed by the runtime; only the expiry event is application-visible.

Detail pages

1. Create the project2. Replace luastra.json3. Replace src/main.luau4. Replace tests/smoke.luau5. Check and run6. Understand and adapt