A UseCase
can extend one of the following base classes:
-
FlowUseCase
- ForUseCase
s that have observable results, in the form of aFlow<T>
, when they are triggered. -
NoResultUseCase
- ForUseCase
s that will execute a given task without returning aResult<T>
. ThisUseCase
will execute its work inworkDispatcher
. -
ResultUseCase
- ForUseCase
s that will execute a given task and return aResult<T>
. ThisUseCase
will execute its work inworkDispatcher
. -
ScopedNoResultUseCase
- ForUseCase
s that will execute a given task, on a specified scope, without returning aResult<T>
. TheUseCase
willlaunch
its work inworkScope
. -
A
UseCase
constructor should accept an instance ofAppCoroutineDispatchers
(usually through DI), which describe the actualDispatcher
s for our application's runtime, or their counterparts when writing unit tests. -
A
UseCase
should only have dependencies on abstractions of local and/or remote repositories.