timeout

fun timeout(timeout: Duration, onTimeout: suspend () -> Unit? = null)(source)

Sets the timeout for this modal, invalidating the modal after expiration, and running the given timeout handler.

If unset, the timeout is set to Modals.defaultTimeout.

Parameters

timeout

The amount of time before the modal is removed

onTimeout

The function to run when the timeout has been reached