Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-17 12:55:48 +02:00
parent 8b576c6492
commit d9bbb09aef
8 changed files with 35 additions and 19 deletions

View file

@ -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