StateEmitter

interface StateEmitter<S : Any>

Base interface implemented by both Bloc and Cubit.

Pure Kotlin / KMP-ready — no Android framework imports.

Inheritors

Properties

Link copied to clipboard
abstract val errorsFlow: SharedFlow<Throwable>

Hot SharedFlow of errors surfaced via addError().

Link copied to clipboard
abstract val isClosed: Boolean

true after close has been called. Further emissions become no-ops.

Link copied to clipboard
abstract val state: S

The current state snapshot.

Link copied to clipboard
abstract val stateFlow: StateFlow<S>

Hot StateFlow that replays the latest state to new collectors.

Functions

Link copied to clipboard
abstract fun close()

Closes the emitter: cancels all coroutines and marks it as closed. Idempotent — safe to call multiple times.