CallbackUtils

Functions

Link copied to clipboard
fun <T> wrapWithCallback(scope: CoroutineScope, callback: (Result<T>) -> Unit, block: suspend () -> T)

Wraps a suspend function with a callback, allowing for safe, asynchronous handling of results or exceptions in a coroutine.