deva666 / NewsReader

Android News Reader app. Kotlin Coroutines, Retrofit and Realm
23 stars 3 forks source link

async from kotlinx.coroutines.experimental.asyn OBSOLETE #2

Closed lauramsolana93 closed 5 years ago

lauramsolana93 commented 5 years ago

Hi @deva666,

we are doing Kotlin in Practice course from Safari Books, we have notate that async used in file RetrofitExtensions it's obsolete.

Could you bring a solution? we have seen that you might have to do a migration to 1.3 versions of this implementations -> implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.19' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.19'

You will find the problem in this line -> fun <T> Call<T>.launchAsync(): Deferred<T> = async{this@launchAsync.execute().body()!!}

deva666 commented 5 years ago

Yes, this is because some Coroutine api has changed in the latest (stable) release. I didn't want to update it because it will differ then from the code in the course. I can update it in a different branch.

lauramsolana93 commented 5 years ago

So, you can do that? it will be very useful for us

Thanks

deva666 commented 5 years ago

here is the branch with Kotlin 1.3 and Coroutines 1.0 https://github.com/deva666/NewsReader/tree/kotlin_1.3

lauramsolana93 commented 5 years ago

Thanks for updating the project :)