Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline fun <reified T> Call<T>.enqueue(
- crossinline onResponse: (Call<T>, Response<T>) -> Unit,
- crossinline onFailure: (Call<T>, Throwable) -> Unit
- ) {
- return this.enqueue(object : Callback<T> {
- override fun onResponse(call: Call<T>, response: Response<T>) {
- onResponse(call, response)
- }
- override fun onFailure(call: Call<T>, t: Throwable) {
- onFailure(call, t)
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement