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
import rx.Observable | |
import rx.Observer | |
import rx.Subscriber | |
import rx.Subscription | |
import rx.functions.Action0 | |
import rx.functions.Action1 | |
fun <T> Observable<T>.uiSubscribe(schedulers: Schedulers, subscriber: Subscriber<in T>): Subscription { | |
return subscribeOn(schedulers.io) | |
.observeOn(schedulers.mainThread) |
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
internal sealed class RepositoryResponse<out T> { | |
class Success<out T>(val data: T) : RepositoryResponse<T>() | |
class Error(val error: String) : RepositoryResponse<Nothing>() | |
class ApiError(val error: ApiError) : | |
RepositoryResponse<Nothing>() | |
} | |
@Serializable | |
internal data class ApiError( | |
val statusCode: Int, |