Animesh Sahu
10/15/2020, 3:54 AMFlow<T>.collectWhile(predicate)
is internal in kotlinx.coroutines.flow ?
It could be useful to suspend a coroutine till value matches some predicate. Is Flow<T>.first(predicate): T
considered to be used (as it utilizes the collectWhile) or something else to be used?louiscad
10/15/2020, 6:23 AMErik
10/15/2020, 2:22 PMfilter
? Your collector is suspended while it doesn't receive new valueselizarov
10/15/2020, 3:42 PMfirst
to suspend until predicate. Looks really nice in code. Like flow.first { it > 0 }
Animesh Sahu
10/15/2020, 3:49 PM