Created
September 6, 2018 23:18
-
-
Save satoshun/55447c1f56e8f9800700671c4c55e9b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface RRR { | |
@GET("data/2.5/weather") | |
fun _getWeather( | |
@Query("a1") a1: Int, | |
@Query("a2") a2: String | |
): Deferred<Resp> | |
} | |
val RRR.getWeather get() = ::_getWeather.toSuspend | |
val <A1, A2, R> ((A1, A2) -> Deferred<R>).toSuspend | |
get(): (suspend (A1, A2) -> R) = { a1, a2 -> this(a1, a2).await() } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment