Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-26 22:07:46 +03:00
parent 2fb5b86505
commit 01cd52cabd
87 changed files with 540 additions and 564 deletions

View file

@ -42,4 +42,16 @@ class Debouncer {
companion object {
const val DEFAULT_WAIT_TIME_MS = 500L
}
}
fun CoroutineScope.launchOnCancellation(block: suspend () -> Unit) {
launch {
try {
awaitCancellation()
} finally {
withContext(NonCancellable) {
block()
}
}
}
}