ClockViewModel

external class ClockViewModel(var clock: <Error class: unknown class> = definedExternally)(source)

A view model which exposes a Clock for user interfaces.

See also

Constructors

Link copied to clipboard
constructor(clock: <Error class: unknown class> = definedExternally)

Properties

Link copied to clipboard

Gets or sets whether the clock can animate. See Clock.canAnimate. This property is observable.

Link copied to clipboard
var clock: <Error class: unknown class>

The clock object wrapped by this view model, if undefined a new instance will be created.

Link copied to clipboard
var clockRange: <Error class: unknown class>

Gets or sets the clock range setting. See Clock.clockRange. This property is observable.

Link copied to clipboard
var clockStep: <Error class: unknown class>

Gets or sets the clock step setting. See Clock.clockStep. This property is observable.

Link copied to clipboard
var currentTime: <Error class: unknown class>

Gets or sets the current time. See Clock.currentTime. This property is observable.

Link copied to clipboard

Gets or sets the clock multiplier. See Clock.multiplier. This property is observable.

Link copied to clipboard

Gets or sets whether the clock should animate. See Clock.shouldAnimate. This property is observable.

Link copied to clipboard
var startTime: <Error class: unknown class>

Gets or sets the start time of the clock. See Clock.startTime. This property is observable.

Link copied to clipboard
var stopTime: <Error class: unknown class>

Gets or sets the stop time of the clock. See Clock.stopTime. This property is observable.

Link copied to clipboard
var systemTime: <Error class: unknown class>

Gets the current system time. This property is observable.

Functions

Link copied to clipboard
fun destroy()

Destroys the view model. Should be called to properly clean up the view model when it is no longer needed.

Link copied to clipboard
Link copied to clipboard

Updates the view model with the contents of the underlying clock. Can be called to force an update of the viewModel if the underlying clock has changed and Clock.tick has not yet been called.