getOrElse

inline fun <T> UiState<T>.getOrElse(onFailure: (throwable: Throwable?) -> T): T

Returns the encapsulated data if this state is UiState.Success, or the result of onFailure function for non-success states.