Package org. orbitmvi. orbit. viewmodel
Types
Android Idling Resource
Link copied to clipboard
Functions
container
Link copied to clipboard
Creates a container scoped with ViewModelScope.
fun <STATE : Parcelable, SIDE_EFFECT : Any> ViewModel.container(initialState: STATE, savedStateHandle: SavedStateHandle, settings: Container.Settings = Container.Settings(idlingRegistry = AndroidIdlingResource()), onCreate: (STATE) -> Unit? = null): Container<STATE, SIDE_EFFECT>
Content copied to clipboard
Creates a container scoped with ViewModelScope and allows you to used the Android ViewModel's saved state support.
observe
Link copied to clipboard
fun <STATE : Any, SIDE_EFFECT : Any> ContainerHost<STATE, SIDE_EFFECT>.observe(lifecycleOwner: LifecycleOwner, state: suspend (STATE) -> Unit? = null, sideEffect: suspend (SIDE_EFFECT) -> Unit? = null)
Content copied to clipboard
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.