Updated on 2026-08-14
This commit is contained in:
parent
8b576c6492
commit
d9bbb09aef
8 changed files with 35 additions and 19 deletions
|
|
@ -19,6 +19,16 @@ suspend fun <R> waitForDelay(delay: Long, block: suspend CoroutineScope.() -> R)
|
|||
actionInvoke.await()
|
||||
}
|
||||
|
||||
suspend inline fun <T, R> T.runSuspendCatching(block: suspend T.() -> R): Result<R> {
|
||||
return try {
|
||||
Result.success(block())
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Throwable) {
|
||||
Result.failure(e)
|
||||
}
|
||||
}
|
||||
|
||||
class Debouncer {
|
||||
|
||||
private var debounceJob: Job? = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue