ExternalStateContainerAdapter

Adapts an OrbitContainer (where internal state = external state) to an OrbitContainer with a different external state type. Used for backwards compatibility with the deprecated org.orbitmvi.orbit.withExternalState extension function.

Constructors

Link copied to clipboard
constructor(delegate: OrbitContainer<INTERNAL_STATE, INTERNAL_STATE, SIDE_EFFECT>, externalTransformState: (INTERNAL_STATE) -> EXTERNAL_STATE)

Properties

Link copied to clipboard
open override val externalRefCountStateFlow: StateFlow<EXTERNAL_STATE>

A version of externalStateFlow ref-counted for the Syntax.repeatOnSubscription operator. Do not use when subscribing to state updates within your OrbitContainerHost.

Link copied to clipboard
open override val externalStateFlow: StateFlow<EXTERNAL_STATE>

A StateFlow of external state updates. Derived from stateFlow via transformState. Emits the latest state upon subscription and serves only distinct values (through equality comparison).

Link copied to clipboard
open override val refCountSideEffectFlow: Flow<SIDE_EFFECT>

A version of sideEffectFlow ref-counted for the Syntax.repeatOnSubscription operator. Do not use when subscribing to state updates within your OrbitContainerHost.

Link copied to clipboard
open override val refCountStateFlow: StateFlow<INTERNAL_STATE>

A version of stateFlow ref-counted for the Syntax.repeatOnSubscription operator. Do not use when subscribing to state updates within your OrbitContainerHost.

Link copied to clipboard
open override val scope: CoroutineScope
Link copied to clipboard
open override val settings: RealSettings

Settings that the container was set up with

Link copied to clipboard
open override val sideEffectFlow: Flow<SIDE_EFFECT>

A Flow of one-off side effects posted from OrbitContainer. Caches side effects when there are no collectors. The size of the cache can be controlled via SettingsBuilder and determines if and when the orbit thread suspends when you post a side effect.

Link copied to clipboard
open override val stateFlow: StateFlow<INTERNAL_STATE>

A StateFlow of internal state updates. Emits the latest state upon subscription and serves only distinct values (through equality comparison).

Functions

Link copied to clipboard
open override fun cancel()

Cancels the container scope and all intents in progress.

Link copied to clipboard
open suspend override fun inlineOrbit(orbitIntent: suspend ContainerContext<INTERNAL_STATE, SIDE_EFFECT>.() -> Unit)

Executes an orbit intent inline, circumventing orbit's dispatching. The intents are built in the OrbitContainerHost using your chosen syntax.

Link copied to clipboard
open suspend override fun joinIntents()

Joins all in progress intents in the container. This suspends until all intents have completed.

Link copied to clipboard
open override fun orbit(orbitIntent: suspend ContainerContext<INTERNAL_STATE, SIDE_EFFECT>.() -> Unit): Job

Executes an orbit intent. The intents are built in the OrbitContainerHost using your chosen syntax.