valueOrElse

inline fun <T> Event<T>.valueOrElse(defaultValue: (Throwable?) -> T): T(source)

Returns the encapsulated value if this Event is a Event.Value, otherwise returns the result of calling defaultValue function.

The function defaultValue will be called with null if this Event is Event.Complete.