Resource

data class Resource<out T>(val status: Status, val data: T?, val message: String?)

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

Parameters

Constructors

Link copied to clipboard
constructor(status: Status, data: T?, message: String?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val data: T?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun requireData(): T

Returns the data if available, or throws an IllegalStateException otherwise