Package-level declarations

Types

Link copied to clipboard
class AbortFlowException(val owner: FlowCollector<*>) : CancellationException
Link copied to clipboard

Enum class representing different coroutine dispatchers for the application. Each enum constant encapsulates a CoroutineDispatcher and a corresponding CoroutineScope.

Functions

Link copied to clipboard
fun <T> Flow<T>.asStateFlow(scope: CoroutineScope, started: SharingStarted = SharingStarted.WhileSubscribed(5000), initialValue: T = blockFirst()): StateFlow<T>
Link copied to clipboard
suspend fun <R> asyncCalls(vararg transforms: suspend () -> R): List<R>

Executes multiple suspend functions asynchronously and waits for all to complete.

Link copied to clipboard
fun <T> Flow<T>.blockFirst(): T

Blocks the current thread until the first value is emitted by the flow. This should be used cautiously, as it blocks the thread.

Link copied to clipboard
fun <T> Flow<T>.blockFirstNotNull(): T

Blocks the current thread until the first non-null value is emitted by the flow. This should be used cautiously, as it blocks the thread.

Link copied to clipboard
inline suspend fun <T> Flow<T>.collectWhile(crossinline predicate: suspend (value: T) -> Boolean)
Link copied to clipboard
fun <T> Flow<T>.filterSuspend(predicate: suspend (T) -> Boolean): Flow<T>

Filters the flow elements based on the given suspendable predicate.

Link copied to clipboard
suspend fun <T> Flow<T>.firstNotNull(): T

The terminal operator that returns the first non-null element emitted by the flow and then cancels flow's collection. Throws NoSuchElementException if the flow was empty.

Link copied to clipboard
suspend fun <T, R> Array<out T>.mapAsync(mapper: suspend (T) -> R): List<R>

Asynchronously maps the elements of the array using the specified suspending function mapper.

suspend fun <T, R> Iterable<T>.mapAsync(mapper: suspend (T) -> R): List<R>

Asynchronously maps the elements of the iterable using the specified suspending function mapper.

Link copied to clipboard
suspend fun <T, R> Iterable<T>.mapIndexedAsync(mapper: suspend (Int, T) -> R): List<R>

Asynchronously maps the elements of the iterable with their index using the specified suspending function mapper.

Link copied to clipboard
fun <T, R> Flow<T>.mapSuspend(transform: suspend (T) -> R): Flow<R>

Maps the flow elements using the given suspendable transformation function.