SHARE
TWEET

Untitled

a guest Jul 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class GetGenresUseCase(
  2.     private val getLocalGenresUseCase: GetLocalGenresUseCase,
  3.     private val getRemoteGenresUseCase: GetRemoteGenresUseCase
  4. ) {
  5.     suspend fun execute(): SResult<List<GenreUI>> {
  6.         return getLocalGenresUseCase.execute().let { localResultList ->
  7.             if(localResultList is SResult.Success && localResultList.data.isNotEmpty()) localResultList
  8.             else getRemoteGenresUseCase.execute()
  9.         }
  10.     }
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top