android-components / mozilla.components.lib.state.ext / flowScoped
@ExperimentalCoroutinesApi @MainThread fun <S :
, A :
>.flowScoped(owner: LifecycleOwner? = null, block: suspend (Flow<
): CoroutineScope (source)
Launches a coroutine in a new MainScope and creates a Flow for observing State changes in
the Store in that scope. Invokes block inside that scope and passes the Flow to it.
owner - An optional LifecycleOwner that will be used to determine when to pause and resume
the store subscription. When the Lifecycle is in STOPPED state then no State will be received.
Once the Lifecycle switches back to at least STARTED state then the latest State and further
updates will be emitted.
The CoroutineScope is getting executed in.