earlyCompleteIf
@ExperimentalCoroutinesApi
Completes the Flow early if the specified stopPredicate is met for any element.
Return
A new Flow that completes early if the stopPredicate is met for any element.
Example usage:
flowOf(1, 2, 3, 4, 5)
.earlyCompleteIf { it == 3 }
.collect(::println) //1, 2, 3
Content copied to clipboard