mapSuccess

fun <T, V> ApiResponse<T>.mapSuccess(transformer: T.() -> V): ApiResponse<V>

Author

skydoves (Jaewoong Eum)

Maps a T type of the ApiResponse to a V type of the ApiResponse if the ApiResponse is ApiResponse.Success.

Return

A V type of the ApiResponse.

Parameters

transformer

A transformer that receives T and returns V.