CancellableActionHandle

class CancellableActionHandle(id: Int, isInterval: Boolean = false)(source)

A handle to a setTimeout or setInterval call which can be used to cancel it.

This is essentially a convenient replacement for:

val id = window.setTimeout(block, timeout)
window.clearTimeout(id)

with the advantage that it can be used for both setTimeout and setInterval calls, as well as mixed mode calls, like starting with an initial timeout before leading into a repeated interval.

Constructors

Link copied to clipboard
constructor(id: Int, isInterval: Boolean = false)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun cancel()