fold

inline fun <T, R> ApiResult<T>.fold(onSuccess: (result: T) -> R, onError: (e: Exception) -> R, noinline onLoading: () -> R? = null): R

Fold this returning the result of onSuccess or onError By default, maps Loading to Error with NotFinishedException