Created
June 26, 2021 08:10
-
-
Save orcchg/e667f6242ccaeceaefd3cb2eb609fa0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class MaybeUseCase<T>( | |
| private val schedulersFactory: SchedulersFactory | |
| ) { | |
| abstract fun sourceImpl(params: Params = Params.EMPTY): Maybe<T> | |
| fun source(params: Params = Params.EMPTY): Maybe<T> = | |
| sourceImpl(params) | |
| .subscribeOn(schedulersFactory.useCase()) | |
| .observeOn(schedulersFactory.main()) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment