execute
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.
Parameters
UseCaseConfig used to process results of internal Coroutine and to set configuration options.
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 gets initial arguments by args.
In case that an error is thrown during the execution of UseCase then UseCaseErrorHandler.globalOnErrorLogger is called with the error as an argument.
Parameters
Arguments used for initial use case initialization.
UseCaseConfig used to process results of internal Coroutine and to set configuration options.
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.
Return
Result that encapsulates either a successful result with Success or a failed result with Error
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.
UseCaseErrorHandler.globalOnErrorLogger is not used in this version of the execute method since it is recommended to call all execute methods with Result return type from launchWithHandler method where UseCaseErrorHandler.globalOnErrorLogger is used.
Return
Result that encapsulates either a successful result with Success or a failed result with Error
Parameters
Arguments used for initial use case initialization.
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.
In case that an error is thrown during the execution of FlowUseCase then UseCaseErrorHandler.globalOnErrorLogger is called with the error as an argument.
Parameters
Arguments used for initial use case initialization.
FlowUseCaseConfig used to process results of internal Flow and to set configuration options.