single

suspend fun <T> Flow<T>.single(): T (source)

The terminal operator, that awaits for one and only one value to be published. Throws NoSuchElementException for empty flow and IllegalStateException for flow that contains more than one element.