Base View Model With Effect
abstract class BaseViewModelWithEffect<S : UiState, A : UiAction, E>(initialState: S) : BaseViewModel<S, A> (source)
Base class for ViewModels that manages UI state, handles user actions, and emits side effects.
This class extends BaseViewModel by adding support for emitting side effects via a SharedFlow. Side effects are typically used for actions that should not directly mutate the UI state but trigger external events, such as navigation or showing a dialog.
Parameters
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Handles a user action and updates the state accordingly using the provided onAction method.