Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-21 15:05:17 +04:00
parent 9a8ff1830d
commit a0798cfef2
252 changed files with 247 additions and 5857 deletions

View file

@ -1,13 +1,6 @@
package com.tangem.utils.coroutines
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.coroutines.*
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
@ -17,12 +10,6 @@ suspend fun <R> runCatching(dispatcher: CoroutineDispatcher, block: suspend () -
}
}
suspend inline fun ifActive(crossinline block: suspend () -> Unit) = coroutineScope {
if (isActive) {
block()
}
}
class Debouncer {
private var debounceJob: Job? = null

View file

@ -1,10 +0,0 @@
package com.tangem.utils.extensions
import java.lang.ref.WeakReference
/**
[REDACTED_AUTHOR]
*/
fun <T> T.toWeakReference(): WeakReference<T> {
return WeakReference(this)
}

View file

@ -3,6 +3,4 @@ package com.tangem.utils.extensions
/**
[REDACTED_AUTHOR]
*/
fun Int.isEven(): Boolean = this % 2 == 0
fun Int.isOdd(): Boolean = !this.isEven()
fun Int.isEven(): Boolean = this % 2 == 0