Package-level declarations

Types

Functions

Link copied to clipboard
fun <STATE : Any, SIDE_EFFECT : Any> ViewModel.container(initialState: STATE, buildSettings: SettingsBuilder.() -> Unit = {}, onCreate: suspend SimpleSyntax<STATE, SIDE_EFFECT>.() -> Unit? = null): Container<STATE, SIDE_EFFECT>

Creates a container scoped with ViewModelScope.

fun <STATE : Parcelable, SIDE_EFFECT : Any> ViewModel.container(initialState: STATE, savedStateHandle: SavedStateHandle, buildSettings: SettingsBuilder.() -> Unit = {}, onCreate: suspend SimpleSyntax<STATE, SIDE_EFFECT>.() -> Unit? = null): Container<STATE, SIDE_EFFECT>

Creates a container scoped with ViewModelScope and allows you to used the Android ViewModel's saved state support.

Link copied to clipboard
fun <STATE : Any, SIDE_EFFECT : Any> ContainerHost<STATE, SIDE_EFFECT>.observe(lifecycleOwner: LifecycleOwner, lifecycleState: Lifecycle.State = Lifecycle.State.STARTED, state: suspend (state: STATE) -> Unit? = null, sideEffect: suspend (sideEffect: SIDE_EFFECT) -> Unit? = null)

Observe Container.stateFlow and Container.sideEffectFlow correctly on Android in one-line of code. These streams are observed when the view is in Lifecycle.State.STARTED.