MavericksViewModelConfig

abstract class MavericksViewModelConfig<S : Any>(debugMode: Boolean, stateStore: MavericksStateStore<S>, coroutineScope: CoroutineScope)

Provides configuration for a MavericksViewModel.

Constructors

MavericksViewModelConfig
Link copied to clipboard
fun <S : Any> MavericksViewModelConfig(debugMode: Boolean, stateStore: MavericksStateStore<S>, coroutineScope: CoroutineScope)

Types

BlockExecutions
Link copied to clipboard

Defines whether a MavericksViewModel.execute invocation should not be run.

Functions

onExecute
Link copied to clipboard
abstract fun <S : MavericksState> onExecute(viewModel: MavericksViewModel<S>): MavericksViewModelConfig.BlockExecutions

Called each time a MavericksViewModel.execute function is invoked. This allows the execute function to be skipped, based on the returned BlockExecutions value.

Properties

coroutineScope
Link copied to clipboard
val coroutineScope: CoroutineScope

The coroutine scope that will be provided to the view model.

debugMode
Link copied to clipboard
val debugMode: Boolean

If true, extra validations will be applied to ensure the view model is used correctly.

stateStore
Link copied to clipboard
val stateStore: MavericksStateStore<S>

The state store instance that will control the state of the ViewModel.