toSuspendFlow

inline suspend fun <T, R> ApiResponse<T>.toSuspendFlow(crossinline transformer: suspend T.() -> R): Flow<R>

Author

skydoves (Jaewoong Eum)

Returns a Flow which contains transformed data using successful data if the response is a ApiResponse.Success and the data is not null.

Return

A coroutines Flow which emits successful data.

Parameters

transformer

A suspension transformer lambda receives successful data and returns anything.