KInterval
A repeating interval that invokes block every period.
Port of the useInterval React hook.
val interval = KInterval(scope = viewModelScope, period = 1.seconds) {
println("tick")
}
// Stops:
interval.clear()Content copied to clipboard
Pass null for period to create the interval in a paused state (call set later).
Parameters
scope
CoroutineScope that owns the interval job.
period
Time between invocations. Pass null to start paused.
block
Suspending action called on each tick.