Created
August 7, 2018 01:16
-
-
Save paulocns/b094e2f807f47f3aff2e602fe3a14ada 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
| class SearchShows @Inject | |
| constructor(private val showRepository: ShowRepository, private val resourceRepository: ResourceRepository) : | |
| UseCase<String>() { | |
| var query: String? = null | |
| override suspend fun executeOnBackground(): String { | |
| query?.let { | |
| val showsInfo = showRepository.searchShow(it) | |
| val showName: String? = showsInfo?.getOrNull(0)?.show?.title | |
| return showName ?: resourceRepository.notFoundShow | |
| } | |
| return "" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment