collect
abstract suspend override fun collect(collector: FlowCollector<T>): Nothing
Content copied to clipboard
Accepts the given collector and emits values into it. To emit values from a shared flow into a specific collector, either collector.emitAll(flow)
or collect { ... }
SAM-conversion can be used.
A shared flow never completes. A call to Flow.collect or any other terminal operator on a shared flow never completes normally.
See also
for implementation and inheritance details.