consoleOut
@ExperimentalCoroutinesApi
Outputs the flow of objects to the console (stdout or stderr) using the specified dispatcher, print, and mapper.
Return
The original flow of objects.
Example usage:
data class Person(val name: String, val age: Int)
val peopleFlow = flowOf(Person("Alice", 30), Person("Bob", 25))
peopleFlow.consoleOut().collect()
Content copied to clipboard
Parameters
dispatcher
The CoroutineDispatcher to use for writing to the console. Defaults to a single-threaded dispatcher.
print
The print mode (Print.BREAK_LINE or Print.NO_BREAK) to use for console output.
mapper
A function that maps each object in the flow to a pair of (output item, output type). Defaults to the original item and OutType.DEFAULT.