Container

interface Container<STATE : Any, SIDE_EFFECT : Any>

The heart of the Orbit MVI system. Represents an MVI container with its input and outputs. You can manipulate the container through the orbit function

Parameters

STATE

The container's state type.

SIDE_EFFECT

The type of side effects posted by this container. Can be Nothing if this container never posts side effects.

Types

Link copied to clipboard
data class Settings(sideEffectBufferSize: Int, idlingRegistry: IdlingResource, intentDispatcher: CoroutineDispatcher, exceptionHandler: CoroutineExceptionHandler?, repeatOnSubscribedStopTimeout: Long)

Represents additional settings to create the container with.

Functions

Link copied to clipboard
abstract suspend fun orbit(orbitIntent: suspend ContainerContext<STATE, SIDE_EFFECT>.() -> Unit)

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

Properties

Link copied to clipboard
abstract val settings: Container.Settings

Settings that the container was set up with

Link copied to clipboard
abstract val sideEffectFlow: Flow<SIDE_EFFECT>

A Flow of one-off side effects posted from Container. Caches side effects when there are no collectors. The size of the cache can be controlled via Container Settings and determines if and when the orbit thread suspends when you post a side effect. The default is unlimited. You don't have to touch this unless you are posting many side effects which could result in OutOfMemoryError.

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

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

Inheritors

Link copied to clipboard
Link copied to clipboard