Target filter
Search Kotlin docs
  • Back
  • Tealium Prism Kotlin SDK Reference
core-ktx/com.tealium.prism.core.ktx/collect

collect

suspend fun <T> Subscribable<T>.collect(collector: FlowCollector<T>)

Collects all emissions from this Subscribable by converting it to a Flow and collecting with the given collector.

This is a convenience equivalent to subscribable.asFlow().collect(collector).

Suspends until the Subscribable calls Observer.onComplete or the calling coroutine is canceled. On cancellation the underlying subscription is disposed automatically.

Parameters

collector

The FlowCollector to receive each emitted value.

Generated by Dokka
(c) Tealium 2026