Base Cr View Model
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.
Constructors
Functions
This method is called when coroutine launched with launchWithHandler throws an exception and this exception isn't CancellationException. By default, it rethrows this exception.
Synchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the cancelPrevious. This version is used for use cases without initial arguments.
Asynchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the config. This version is used for use cases without initial arguments.
Asynchronously executes use case and consumes data from flow on UI thread. By default all previous pending executions are canceled, this can be changed by config. When suspend function in use case finishes, onComplete is called on UI thread. This version is gets initial arguments by args.
Synchronously executes use case and saves it's Deferred. By default all previous pending executions are canceled, this can be changed by the cancelPrevious. This version gets initial arguments by args.
Provides Dispatcher for background tasks. This may be overridden for testing purposes
Launch suspend block in coroutineScope. Encapsulates this call with try catch block and when an exception is thrown then it is logged in UseCaseErrorHandler.globalOnErrorLogger and handled by defaultErrorHandler.