ShutdownContext

The context in which the store may be shut down.

Provides a limited API to manipulate values that outlive the full PipelineContext.

Properties

Link copied to clipboard
abstract val config: StoreConfiguration<S>

The StoreConfiguration of this store

Link copied to clipboard
abstract val isActive: Boolean

Whether the Store is active (store is started or being started).

Link copied to clipboard
abstract val isStarted: Boolean

Whether the Store has started fully.

Link copied to clipboard

Obtain the current state in an unsafe manner.

Link copied to clipboard
abstract override val states: StateFlow<S>

A flow of states to be rendered by the subscriber.

Functions

Link copied to clipboard
abstract suspend fun awaitStartup()

Wait while the Store is started. If it is already started, returns immediately.

Link copied to clipboard
abstract suspend fun awaitUntilClosed()

Suspend until the store is closed

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract suspend fun closeAndWait()

Await while the Store is fully closed.

Link copied to clipboard
abstract fun compareAndSet(old: S, new: S): Boolean

Directly compare and set the current state.

Link copied to clipboard
@JvmName(name = "updateStateImmediateTyped")
inline fun <T : S, S : MVIState> ImmediateStateReceiver<S>.updateStateImmediate(transform: T.() -> S)

A typed overload of updateStateImmediate.

inline fun <S : MVIState> ImmediateStateReceiver<S>.updateStateImmediate(transform: S.() -> S)

A function that obtains current state and updates it atomically (in the thread context), and non-atomically in the coroutine context, which means it can cause races when you want to update states in parallel.