Updated on 2026-08-14
This commit is contained in:
parent
2803ac9eef
commit
ee722c5f46
11 changed files with 327 additions and 198 deletions
|
|
@ -0,0 +1,10 @@
|
|||
package com.tangem.utils.coroutines
|
||||
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
suspend fun <R> runCatching(dispatcher: CoroutineDispatcher, block: suspend () -> R): Result<R> {
|
||||
return runCatching {
|
||||
withContext(dispatcher) { block() }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue