Created
May 2, 2020 10:34
-
-
Save pavlospt/1e78f8868376351267e2028702118fa1 to your computer and use it in GitHub Desktop.
NoResultUseCase.kt
This file contains 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 NoResultUseCase<in Params> { | |
protected abstract val workDispatcher: CoroutineDispatcher | |
abstract suspend fun run(params: Params) | |
suspend operator fun invoke(params: Params) = withContext(workDispatcher) { | |
run(params) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment