Result

sealed class Result<out R>

A generic class that holds a value with its loading status.

Inheritors

Types

Link copied to clipboard
object Empty : Result<Nothing>
Link copied to clipboard
data class Error(val exception: Exception) : Result<Nothing>
Link copied to clipboard
object Loading : Result<Nothing>
Link copied to clipboard
data class Success<out T>(val data: T) : Result<T>

Properties

Link copied to clipboard
val <T> Result<T>.data: T?

Value of Result.

Functions

Link copied to clipboard
fun <T> Result<T>.successOr(fallback: T): T
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <T> Result<T>.updateOnSuccess(liveData: MutableLiveData<T>)

Updates the value of liveData if Result is of type Result.Success.