Updated on 2026-08-14
This commit is contained in:
parent
0b8efe6d02
commit
2fcc9abc8e
2 changed files with 20 additions and 11 deletions
|
|
@ -10,6 +10,13 @@ suspend fun <R> runCatching(dispatcher: CoroutineDispatcher, block: suspend () -
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun <R> waitForDelay(delay: Long, block: suspend CoroutineScope.() -> R): R = coroutineScope {
|
||||
val minWaitingTime = async { delay(delay) }
|
||||
val actionInvoke = async { block() }
|
||||
minWaitingTime.await()
|
||||
actionInvoke.await()
|
||||
}
|
||||
|
||||
class Debouncer {
|
||||
|
||||
private var debounceJob: Job? = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue