StateConsumer

fun interface StateConsumer<in S : MVIState>

An entity that can render states coming from a StateProvider. Most likely, a subscriber of the Store.

Inheritors

Functions

Link copied to clipboard
abstract fun render(state: S)

Render a new state. This function will be called each time a new state is received.

Link copied to clipboard
fun <S : MVIState, I : MVIIntent, A : MVIAction> StateConsumer<S>.subscribe(store: ImmutableStore<S, I, A>, scope: CoroutineScope): Job

Subscribe to the store and invoke StateConsumer.render in the provided scope.