-
- All Implemented Interfaces:
-
androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver,app.futured.arkitekt.crusecases.CoroutineScopeOwner
public abstract class BaseCrViewModel<S extends ViewState> extends BaseViewModel<S> implements CoroutineScopeOwner
Base ViewModel class prepared for providing data to UI through LiveData and obtaining data from Stores (Repositories) by executing Coroutine based use cases like UseCase and FlowUseCase.
-
-
Field Summary
Fields Modifier and Type Field Description private final CoroutineScopecoroutineScopeprivate SavedStateHandleinternalSavedStateHandleprivate final SavedStateHandlerequireSavedStateHandleprivate final SviewState
-
Constructor Summary
Constructors Constructor Description BaseCrViewModel()
-
Method Summary
Modifier and Type Method Description CoroutineScopegetCoroutineScope()CoroutineScope scope used to execute coroutine based use cases. final SavedStateHandlegetInternalSavedStateHandle()final UnitsetInternalSavedStateHandle(SavedStateHandle internalSavedStateHandle)final SavedStateHandlegetRequireSavedStateHandle()abstract SgetViewState()-
Methods inherited from class app.futured.arkitekt.core.BaseViewModel
addCloseable, clear, getTag, onCreate, onDestroy, onPause, onResume, onStop, setTagIfAbsent -
Methods inherited from class app.futured.arkitekt.crusecases.BaseCrViewModel
defaultErrorHandler, execute, execute, execute, execute, execute, execute, getWorkerDispatcher, launchWithHandler, observeEvent, observeWithoutOwner, observeWithoutOwner, observeWithoutOwner, onStart, onStart, sendEvent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCoroutineScope
CoroutineScope getCoroutineScope()
CoroutineScope scope used to execute coroutine based use cases. It is your responsibility to cancel it when all running tasks should be stopped
-
getInternalSavedStateHandle
final SavedStateHandle getInternalSavedStateHandle()
-
setInternalSavedStateHandle
final Unit setInternalSavedStateHandle(SavedStateHandle internalSavedStateHandle)
-
getRequireSavedStateHandle
final SavedStateHandle getRequireSavedStateHandle()
-
getViewState
abstract S getViewState()
-
-
-
-