Skip to content

Instantly share code, notes, and snippets.

@lukaszkalnik
Created June 18, 2020 16:07
Show Gist options
  • Save lukaszkalnik/2ce1a80657435311053622cbe2b4fbd5 to your computer and use it in GitHub Desktop.
Save lukaszkalnik/2ce1a80657435311053622cbe2b4fbd5 to your computer and use it in GitHub Desktop.
private class EitherCallAdapter<R>(
private val successType: Type
) : CallAdapter<R, Call<Either<ApiError, R>>> {
override fun adapt(call: Call<R>): Call<Either<ApiError, R>> = EitherCall(call, successType)
override fun responseType(): Type = successType
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment