android-components / mozilla.components.lib.state.ext / flow


@ExperimentalCoroutinesApi @MainThread fun <S : State, A : Action> Store<S, A>.flow(owner: LifecycleOwner? = null): Flow<S> (source)

Creates a Flow for observing State changes in the Store.


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.