Success

data class Success<out T>(value: T) : Async<T>

Functions

invoke
Link copied to clipboard
open operator override fun invoke(): T

Returns the value or null.

Properties

complete
Link copied to clipboard
val complete: Boolean
metadata
Link copied to clipboard
var metadata: Any? = null

Optional information about the value. This is intended to support tooling (eg logging). It allows data about the original Observable to be kept and accessed later. For example, you could map a network request to just the data you need in the value, but your base layers could keep metadata about the request, like timing, for logging.

shouldLoad
Link copied to clipboard
val shouldLoad: Boolean

Extensions

getMetadata
Link copied to clipboard
fun <T> Success<*>.getMetadata(): T?

Helper to get metadata on a Success instance.

setMetadata
Link copied to clipboard
fun <T> Success<*>.setMetadata(metadata: T)

Helper to set metadata on a Success instance.