class

Term2::Components::CountdownTimer

Inherits Term2::Model < Reference < Object

Constructors

new(duration : Time::Span, remaining : Time::Span, running : Bool, last_tick : Time | Nil, interval : Time::Span = 100.milliseconds)
Source
new(duration : Time::Span, interval : Time::Span = 100.milliseconds)
Source

Instance methods

duration
Source
init

Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.

Source
interval
Source
last_tick
Source
remaining
Source
running?
Source
schedule_tick
Source
update(msg : Msg) : Tuple(Model, Cmd)

Update is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.

Source
view

View renders the program's UI, which is just a string. The view is rendered after every Update.

Source

Nested types