Updated on 2026-08-14

This commit is contained in:
Tangem 2022-11-21 17:21:57 +03:00
parent 2803ac9eef
commit ee722c5f46
11 changed files with 327 additions and 198 deletions

View file

@ -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() }
}
}