MviViewModel

interface MviViewModel<State, I, E>(source)

Core contract for MVI ViewModels in Kindling.

Defines a strict unidirectional flow where:

  1. The UI dispatches an Intent.

  2. The ViewModel processes the Intent and updates the state or emits an Effect.

  3. The UI observes the state and reacts to effects.

Architecture overview:

UI (Composable) --[Intent]--> ViewModel --[State / Effect]--> UI (Composable)

Type Parameters

State

The UI state type.

I

The Intent type.

E

The Effect type.

Inheritors

Properties

Link copied to clipboard
abstract val effects: Flow<E>
Link copied to clipboard
abstract val state: StateFlow<State>

Functions

Link copied to clipboard
abstract fun dispatch(intent: I)