gleamtea/timer
A bubble: a countdown timer. Like the spinner, it keeps itself running by
re-scheduling its own tick; forward every message to update.
Types
Values
pub fn new(
timeout_ms timeout_ms: Int,
interval_ms interval_ms: Int,
) -> Timer
pub fn start(timer: Timer) -> gleamtea.Cmd(msg)
Start (or resume) counting down; returns the command that schedules the first tick.
pub fn toggle(timer: Timer) -> #(Timer, gleamtea.Cmd(msg))
Pause/resume. Returns the (possibly re-armed) command.
pub fn update(
msg: msg,
timer: Timer,
) -> #(Timer, gleamtea.Cmd(msg))
Advance on the timer’s own tick; ignore other messages.