flowOfSuspend

fun <T> flowOfSuspend(item: suspend () -> T): Flow<T>

Creates a Flow that emits a single item, which is the result of invoking the provided suspending function item.

Return

A Flow that emits the result of the suspending function.

Parameters

item

The suspending function to be invoked when the flow is collected.