← Back to Kairo Docs|API Reference (Dokka)

Package-level declarations

Functions

Link copied to clipboard
suspend fun <T> FlowCollector<T>.emitAll(collection: Iterable<T>)

Emits all elements from the collection into this flow. Convenience overload of emitAll for Iterable.

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

Adapted from single and singleOrNull. Returns the single element, or null if the flow is empty. If the flow has more than one element, throws IllegalArgumentException.

inline suspend fun <T> Flow<T>.singleNullOrThrow(crossinline predicate: (T) -> Boolean): T?

Adapted from single and singleOrNull. Returns the single element matching the given predicate, or null if no elements match. If more than one element matches, throws IllegalArgumentException.