vector / com.haroldadmin.vector / VectorViewModelFactory / create

create

open fun create(initialState:S, owner:ViewModelOwner, handle:SavedStateHandle):VM?

Used to create the requested ViewModel. This method needs to be implemented if your ViewModel has dependencies other than those of a VectorViewModel or a SavedStateVectorViewModel. However, if you are using a different kind of factory to create your ViewModel, you might skip implementing this method.

Parameters

initialState - The initial state to be given to the ViewModel

owner - The ViewModelOwner for this ViewModel. Can be used to access context, dependency graph, etc.

handle - The saved state handle to be given to the ViewModel, if needed.

Return The ViewModel to be created using this function.