Success

data class Success<out T>(val data: T) : Result<T>

Constructors

Link copied to clipboard
constructor(data: T)

Properties

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

Value of Result.

Functions

Link copied to clipboard
fun <T, R> Result<T>.map(block: (T) -> Result<R>): Result<R>

Convenience function to map the result from type to type

Link copied to clipboard
fun <T> Result<T>.successOr(fallback: T): T
Link copied to clipboard
inline fun <T> Result<T>.updateOnSuccess(liveData: Any)

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