StateStream

interface StateStream<out Value : Any>

A StateStream is a source of asynchronous (state) data. It's a hot stream, identical to kotlinx.coroutines.flow.StateFlow without exposing the replayCache and meant to deal with State data (compared to SideEffectStream for SideEffects).

A StateStream emits:

  • no duplicate values

  • an initial value upon subscription (analogous BehaviorSubject)

A SideEffectStream emits:

  • all values even duplicates

  • no initial value upon subscription (analogous PublishSubject)

Inheritors

Functions

Link copied to clipboard
abstract suspend fun collect(collector: FlowCollector<Value>)

Accepts the given FlowCollector and emits values into it.

Properties

Link copied to clipboard
abstract val value: Value

The current value.