Package 

Class MavericksViewModel


  • 
    public abstract class MavericksViewModel<S extends MavericksState>
    
                        

    All Mavericks ViewModels must extend this class. In Mavericks, ViewModels are generic on a single state class. The ViewModel owns all state modifications via setState and other classes may observe the state.

    From a MavericksView/Fragment, using the view model provider delegates will automatically subscribe to state updates in a lifecycle-aware way and call MavericksView.invalidate whenever it changes.

    Other classes can observe the state via stateFlow.