suspendOnProcedure

inline suspend fun <T> ApiResponse<T>.suspendOnProcedure(    crossinline onSuccess: suspend ApiResponse.Success<T>.() -> Unit,     crossinline onError: suspend ApiResponse.Failure.Error<T>.() -> Unit,     crossinline onException: suspend ApiResponse.Failure.Exception<T>.() -> Unit): ApiResponse<T>

Author

skydoves (Jaewoong Eum)

A suspension scope function that will be executed for handling successful, error, exception responses. This function receives and handles ApiResponse.onSuccess, ApiResponse.onError, and ApiResponse.onException in one scope.

Return

The original ApiResponse.

Parameters

onSuccess

A suspension scope function that would be executed for handling successful responses if the request succeeds.

onError

A suspension scope function that would be executed for handling error responses if the request failed.

onException

A suspension scope function that would be executed for handling exception responses if the request get an exception.