Skip to content

Instantly share code, notes, and snippets.

@JacquesSmuts
Created April 27, 2019 14:47
Show Gist options
  • Save JacquesSmuts/96af861d1096ed8feb8c299d19a623b0 to your computer and use it in GitHub Desktop.
Save JacquesSmuts/96af861d1096ed8feb8c299d19a623b0 to your computer and use it in GitHub Desktop.
import kotlin.reflect.KSuspendFunction1 // You have to import this manually
import kotlin.reflect.KSuspendFunction2 // You have to import this manually
inline suspend fun <reified Service: RetroService, Result> doSuspendedApiCall(
services: List<RetroService>,
apiCall: KSuspendFunction1<Service, Result>
): Result? {
// identical to doApiCall
}
inline suspend fun <reified Service: RetroService, Input, Result> doSuspendedApiCallWithParam(
services: List<RetroService>,
apiCall: KSuspendFunction2<Service, Input, Result>,
input: Input
): Result? {
// identical to doApiCallWithParam
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment